Docs de PDFiumPas

Anchors Propiedad

Esta entrada API conserva identificadores, firmas, bloques de código y términos PDF en su forma original.
Componente: TPdfView  ·  Unidad: PDFium
Especifica qué bordes del visor mantienen una distancia fija respecto a los bordes correspondientes de su contenedor cuando este se redimensiona

Sintaxis

property Anchors: TAnchors; // published, default [akLeft, akTop]

Descripción

Anchors are an alternative to Align that give pixel-accurate control over how the PDF viewer follows its parent container. Each element of the set (akLeft, akTop, akRight, akBottom) fija ese borde del visor al mismo borde del contenedor — si ambos bordes opuestos están anclados, el visor se estira cuando el contenedor se redimensiona; si solo uno está anclado, el visor conserva su tamaño y se desplaza

The most common layout for a PDF reader inside a fixed-width inspector pane or a wizard step is [akLeft, akTop, akRight, akBottom], which is functionally equivalent to alClient but leaves the design-time bounding rectangle intact and lets you nest other controls around the viewer without z-order surprises.

Siempre que un ancla hace que el visor crezca o se encoja, el controlador heredado de cambio de tamaño vuelve a calcular el área de desplazamiento; el ajuste activo FitMode (when not pfmNone) se vuelve a aplicar para que el contenido de la página conserve su relación visual con el área visible

Notas

Ejemplo

// Lock the viewer to all four edges of its parent panel
procedure TForm1.ConfigureViewer;
begin
  PdfView1.Parent := PanelMain;
  PdfView1.Align := alNone;
  PdfView1.SetBounds(8, 8, PanelMain.ClientWidth - 16,
    PanelMain.ClientHeight - 16);
  PdfView1.Anchors := [akLeft, akTop, akRight, akBottom];
  PdfView1.Constraints.MinWidth := 320;
  PdfView1.Constraints.MinHeight := 240;
end;

Véase también

Align, Constraints, OnResize, FitMode