THPDFViewer Current View Printing
Draws or prints the current vector view with deterministic aspect-preserving fit and centered placement
Declarations
function HPDFViewerFitRect(const Bounds: TRect;
ContentWidth, ContentHeight: Integer): TRect;
function THPDFViewerModel.DrawCurrentView(Canvas: TCanvas;
const Bounds: TRect; DPI: Integer= 150): boolean;
function THPDFViewer.DrawCurrentView(Canvas: TCanvas;
const Bounds: TRect; DPI: Integer= 150): boolean;
function THPDFViewerModel.PrintCurrentView(Printer: TPrinter;
const DocumentTitle: string= ''; DPI: Integer= 300): boolean;
function THPDFViewer.PrintCurrentView(Printer: TPrinter;
const DocumentTitle: string= ''; DPI: Integer= 300): boolean;
Behavior
HPDFViewerFitRectreturns the largest centered rectangle that preserves the source aspect ratioDrawCurrentViewaccepts any caller-ownedTCanvasand bounds- The active page and
ViewRotationare preserved through the vector metafile path PrintCurrentViewfits the result to the printer page and optionally assigns the print job title- A failed draw aborts an active print job before returning or propagating an exception
Example
PDFViewer.PrintCurrentView(Printer, 'Current PDF view', 300);