|
dxHotPDFExportReportLink DevExpress ExpressPrinting System adapter (
|
FastReport adapter QuickReport adapter ReportBuilder device |
|
DevExpress ExpressPrinting System (XtraPrinting / XtraReports / cxGrid printable links / i slično) PDF export adapter koji koristi HotPDF kao osnovni PDF backend umesto DevExpress-ovog sopstvenog dxPSExportToPDF / TdxPSPDFExport emitera Namenjen je projektima koji već ugrađuju HotPDF i žele jedan PDF backend kroz celu aplikaciju
Options record: type TdxHotPDFExportOptions = record Title, Author, Subject, Keywords: string; PDFVersion : TPDFVersType; // default pdf17 Compression: TPDFCompressionLevel; // default clDefault RenderDPI : Integer; // default 200 end;
function dxHotPDFDefaultOptions: TdxHotPDFExportOptions;
File-based entry points: function dxHotPDFExportReportLinkToFile( AReportLink: TBasedxReportLink; const AOutputFileName: string; const AOptions: TdxHotPDFExportOptions): Boolean; overload; function dxHotPDFExportReportLinkToFile( AReportLink: TBasedxReportLink; const AOutputFileName: string): Boolean; overload;
Stream-based entry points: function dxHotPDFExportReportLinkToStream( AReportLink: TBasedxReportLink; AOutputStream: TStream; const AOptions: TdxHotPDFExportOptions): Boolean; overload; function dxHotPDFExportReportLinkToStream( AReportLink: TBasedxReportLink; AOutputStream: TStream): Boolean; overload;
Opis DevExpress-ov printing sistem je zasnovan na TBasedxReportLink - apstraktnom linku koji povezuje printable komponentu (cxGrid, cxRichEdit, cxScheduler, cxPivotGrid i slično) sa TdxComponentPrinter-om Printer / link sastavlja stranice, a zatim izlaže zaštićeni PaintPage(ACanvas, APageBounds, APageIndex, AContinuousIndex, AZoomFactor) metod koji iscrtava jednu stranicu na bilo koji TCanvas
Ovaj adapter preslikava petlju iz DevExpress-ovog TdxPSPDFReportExportProvider.Build, ali umesto da izlaz
1. Pozivalac pokreće dxHotPDFExportReportLinkToFile ili dxHotPDFExportReportLinkToStream sa pripremljenim TBasedxReportLink 2. The adapter calls 3. Za svaki indeks strane, poziva se RenderInfo.GetActualPageRenderInfo, izračunava se veličina strane u PDF tačkama koristeći DevExpress-ov odnos PointsPerInch / UnitsPerInch, pravi se TMetafile sa odabranim render DPI i prikazuje se stranica kroz PaintPage(MetaCanvas, ...) 4. Dodaje se nova HotPDF stranica (ili se ponovo koristi automatski kreirana prva stranica), dimenzionisana prema izračunatim point dimenzijama, a metafile se pušta kroz ShowEnhancedMetafile 5. HotPDF.EndDoc upisuje PDF; za stream overload-e, privremeni fajl se zatim kopira u TStream koji je prosledio pozivalac
Options Title / Author / Subject / Keywords - metapodaci dokumenta Kada je Title prazan, adapter se vraća na AReportLink.ReportTitle.Text, zatim na AReportLink.Name, tako da PDF uvek ima ne-prazan title PDFVersion - nivo PDF specifikacije koji dokument treba da cilja. Podrazumevana vrednost je pdf17
RenderDPI - gustina piksela koja se koristi pri rasterizaciji svake stranice kroz TMetafileCanvas Veća vrednost = oštriji tekst i linije, ali veći metafile i PDF 200 (podrazumevano) daje rezultate kvalitetne za štampu bez ogromnih fajlova Vrednosti ≤ 0 se ograničavaju na 200
Typical workflow
dxComponentPrinter1.CurrentLink := cxGridReportLink1; dxHotPDFExportReportLinkToFile(cxGridReportLink1, 'Grid.pdf');
Or with custom options:
Opts := dxHotPDFDefaultOptions; Opts.Title := 'Q1 Sales'; Opts.RenderDPI := 300; dxHotPDFExportReportLinkToFile(cxGridReportLink1, 'Grid.pdf', Opts);
Podržane porodice linkova Svaki potomak TBasedxReportLink Ovo obuhvata cxGrid, cxRichEdit, cxScheduler, cxPivotGrid, plus sve prilagođene linkove izvedene iz iste bazne klase Adapter ne zavisi od konkretnog tipa linka zato što je PaintPage ugovor definisan na bazi
Capabilities preserved Vektorski i raster sadržaj stranice koji emituje svaka DevExpress family linkova (cxGrid, cxScheduler, cxRichEdit, cxPivotGrid, prilagođeni linkovi) GDI-rešeni tekstualni stringovi (DevExpress renderuje tekst preko TCanvas-a; metafile verno beleži GDI tekstualne pozive)
Limitations of the metafile bridge Pošto su stranice snimljene kao enhanced metafajlovi, DevExpress-specifične PDF osobine koje zahtevaju strukturne informacije (interaktivna AcroForm polja, imenovane destinacije, bookmarkovi / konture, PDF/A ili PDF/X usklađenost) se ne prenose. Izlaz je verna vizuelna reprodukcija onoga što DevExpress renderuje, a ne strukturirani PDF
Packaging note Adapter se nalazi u Lib\Addons\DevExpress\ i nije deo glavnih HotPDF*.dpk paketa, pa se zavisnost DevExpress ExpressPrinting učitava samo u projektima koji se opredele za adapter. Smoke test (smoke_dx_hotpdf.dpr) nalazi se uz jedinicu
See also: TfrxHotPDFExport, TQRHotPDFExportFilter, TppHotPDFDevice, THPDFPage.ShowMetafile, Enhanced EMF/WMF Support |