THPDFViewerModel Metafile Methods
Creates scalable enhanced metafiles for loaded PDF pages without a Viewer control
Declarations
function CreatePageMetafile(PageIndex: Integer; DPI: Integer= 150): TMetafile;
function CreateCurrentPageMetafile(DPI: Integer= 150): TMetafile;Usage notes
- The caller owns and must free each returned
TMetafileand DPI is clamped from 12 through 2400 - DPI values are clamped from 12 through 2400
- Invalid document or page state returns
nil - Text and vector paths remain scalable EMF records
- The active
ViewRotationis applied without changing the loaded PDF page - Rotation by 90 or 270 degrees swaps the physical metafile width and height
Example
Metafile := Viewer.Model.CreateCurrentPageMetafile(300);
try
Metafile.SaveToFile('current-view.emf');
finally
Metafile.Free;
end;