YOUSEFUL / DELPHI / COMPONENTS

TAtlasPdfSize

Width and height of a PDF page as reported by the Windows PDF engine (device-independent pixels at 96 dpi).

Record Unit Atlas.Pdf · Product Atlas VCL

Description

Returned by TAtlasPdfDocument.PageSize. The values are Single and come straight from the engine, which reports pages in device-independent pixels at 96 dpi rather than PDF points: multiply points by 96/72 to predict them (300 × 400 points give 400 × 533). Use the ratio to compute the rendered height for a chosen width.

Members

MemberKindWhat it does
WidthfieldPage width in device-independent pixels.
HeightfieldPage height in device-independent pixels.

Fields

Width field

TAtlasPdfSize = record Width, Height: Single; end;

Page width in device-independent pixels.

Height field

TAtlasPdfSize = record Width, Height: Single; end;

Page height in device-independent pixels.

Examples

Predict the rendered height

RenderPage keeps the aspect ratio; this computes the height it will produce.

pascal
uses Atlas.Pdf;

function RenderedHeight(Document: TAtlasPdfDocument; Page, Width: Integer): Integer;
var
  Size: TAtlasPdfSize;
begin
  Size := Document.PageSize(Page);
  Result := Round(Width * Double(Size.Height) / Size.Width);   // 800 for Width = 600 and a 3:4 page
end;

TAtlasPdfDocument · TAtlasPdfRect

Also in Atlas VCL

TAtlasTable · TAtlasGrid · TAtlasValueEdit · TAtlasTree · TAtlasWorkbook · TAtlasSheetGrid · TAtlasPivot · TAtlasInspector · TAtlasRichEdit · TAtlasSpellChecker · TAtlasChart · TAtlasGauge · TAtlasThemer · TAtlasWizard · TAtlasWorkspace · TAtlasCommandBar · TAtlasActionTile · TAtlasTileBoard · TAtlasNavigation · TAtlasMap · TAtlasGraph · TAtlasDiagram · TAtlasPrintDocument · TAtlasSchedule · TAtlasScheduler · TAtlasTaskPlan · TAtlasGantt · TAtlasPdfDocument · TAtlasPdfViewer