PDFiumVCL Docs

Align property

この API エントリでは識別子、シグネチャ、コードブロック、PDF 用語を元の表記のまま保持します。
Component: TPdfView  ·  Unit: PDFium
Controls how the PDF viewer is laid out inside its parent container.

Syntax

property Align: TAlign; // published, inherited from TControl

Description

Because TPdfView descends from TScrollingWinControl, it participates in the standard VCL/LCL layout system. Align tells the parent how to dock the viewer against one or more edges, which is the most common way to make a PDF reader fill an entire form, a panel inside a splitter, or a region of a tab sheet.

The most useful value for a PDF viewer is alClient, which makes the viewer absorb every remaining pixel of its parent after toolbars, status bars and side panels have been positioned. Combined with FitMode the page artwork rescales automatically whenever the user resizes the form, so the document always uses the largest possible area.

Whenever Align takes effect, the inherited resize logic recomputes the client area and the viewer's internal scroll range is rebuilt against the new size, so vertical scroll bars and the current page position stay correct. The OnResize event fires after the alignment is applied.

Remarks

Example

// Build a viewer that fills the form except for a toolbar on top
procedure TForm1.FormCreate(Sender: TObject);
begin
  ToolBar1.Align := alTop;
  StatusBar1.Align := alBottom;
  PdfView1.Parent := Self;
  PdfView1.Align := alClient;
  PdfView1.FitMode := pfmFitToWidth;
  PdfView1.Pdf := Pdf1;
  Pdf1.LoadFromFile('sample.pdf');
  PdfView1.Active := True;
end;

See Also

Anchors, Constraints, OnResize, FitMode