YOUSEFUL / DELPHI / COMPONENTS

EAtlasPdfError

Exception raised by TAtlasPdfDocument and TAtlasPdfViewer for Atlas VCL's own checks: missing file, wrong thread, page or zoom out of range, invalid render size, timeout.

Class Unit Atlas.Pdf · Inherits Exception · Product Atlas VCL

Description

Messages: PDF file not found: ..., Use the PDF document on its creating thread, PDF contains no pages, PDF page index out of range, PDF render width must be 32-4096 pixels, PDF rendered page is too tall, Windows PDF operation timed out, Windows PDF operation cancelled, PDF rendered output size is invalid, Incomplete PDF render stream, PDF page out of range and PDF zoom must be 25-300 percent. Failures inside the Windows PDF engine (wrong password, damaged file, missing runtime) are EOleSysError instead, so catch both when opening untrusted files.

This type has no members of its own beyond those listed in its description.

Examples

Open a file chosen by the user

Both exception classes are handled; the viewer keeps its previous document either way.

pascal
uses System.Win.ComObj, Vcl.Dialogs, Atlas.Pdf;

procedure OpenPdf(Viewer: TAtlasPdfViewer; const FileName: string);
begin
  try
    Viewer.LoadFile(FileName);
  except
    on E: EAtlasPdfError do ShowMessage(E.Message);                       // Atlas VCL's own checks
    on E: EOleSysError do ShowMessage('Windows could not read the PDF: ' + E.Message);
  end;
end;

TAtlasPdfDocument · TAtlasPdfViewer

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