DARenderPageToStream
Direct access functionality, Rendering and printing
Description
Renders one Direct Access page and writes the completed image to the supplied TStream using the renderer selected with SelectRenderer
Returns 1 on success or 0 on failure; a render failure leaves the target stream unchanged, and LastRenderError describes the failure
This stream entry point is available in the Delphi edition
Renderer 1 uses the internal renderer, renderer 2 uses Cairo, and renderer 3 uses PDFium when the corresponding backend is available in the build
Configure optional libraries with SetCairoFileName or SetPDFiumFileName before selecting them
Pending Direct Access edits are included, the source handle remains open, and rendering does not update its modification date
PDFium supports BMP, JPEG, PNG, GIF, TIFF, and G4 TIFF raster output; other formats fail explicitly
Syntax
Delphi
Function TPDFlib.DARenderPageToStream(FileHandle, PageRef, Options: Integer; DPI: Double; Target: TStream): Integer;
Parameters
| FileHandle | A handle returned by the DAOpenFile, DAOpenFileReadOnly or DAOpenFromStream functions |
|---|---|
| PageRef | A page reference returned by the DAFindPage or DANewPage functions |
| Options | PDF_RENDER_BMP = 0 (BMP output), PDF_RENDER_JPEG = 1 (JPEG output), PDF_RENDER_WMF = 2 (WMF output), PDF_RENDER_EMF = 3 (EMF output), PDF_RENDER_EPS = 4 (EPS output), PDF_RENDER_PNG = 5 (PNG output), PDF_RENDER_GIF = 6 (GIF output), PDF_RENDER_TIFF_RGB = 7 (TIFF output), PDF_RENDER_EMFPLUS = 8 (EMF+ output), PDF_RENDER_HTML5 = 9 (HTML5 output), PDF_RENDER_TIFF_G4 = 10 (G4 TIFF output), PDF_RENDER_EMF_DUAL = 11 (EMF+ Dual output) |
| DPI | The DPI to use when rendering the page. Values over 300 will cause excessive memory usage |
| Target | The stream to place the rendered page into |
Return values
| 0 | The page could not be rendered. Check that the FileHandle and PageRef parameters contain valid values |
|---|---|
| 1 | The page was rendered and the image data was put into the stream |