RenderPagesToPrintStream

Rendering, printing, server output

Description

Writes a complete driver-independent print stream for the selected page range without opening a printer, using the current page crop, optional-content visibility, render scale, and selected renderer

Syntax

Delphi

Function TPDFlib.RenderPagesToPrintStream(DPI: Double; Const PageRanges: WideString; PrintFormat, Options: Integer; Target: TStream): Integer;

Parameters

DPIRaster resolution from 1 through 4800; EPS and PostScript retain vector page content while using this value for embedded image processing
PageRangesA standard one-based range such as 1-3,5, All, Odd, or Even
PrintFormatPDF_PRINT_STREAM_POSTSCRIPT (0), PDF_PRINT_STREAM_EPS (1), PDF_PRINT_STREAM_PCL (2), or PDF_PRINT_STREAM_PWG (3)
OptionsCombine PDF_PRINT_STREAM_MONOCHROME (1), PDF_PRINT_STREAM_DUPLEX (2), PDF_PRINT_STREAM_TUMBLE (4), and PDF_PRINT_STREAM_PJL (8) as allowed by the selected format
TargetThe destination stream at its current position

Return values

Returns 1 when the complete stream is written and 0 when validation, rendering, conversion, or output fails

Remarks

PostScript is a DSC Level 3 multi-page document assembled from vector EPS page programs, while EPS accepts exactly one page and no options

PCL defaults to RGB PCL 5c adaptive raster frames and switches to one-bit PCL mode 2 when PDF_PRINT_STREAM_MONOCHROME is set; PDF_PRINT_STREAM_PJL adds a UEL and PJL job envelope only for PCL

PWG output uses the RaS2 signature, 1796-byte big-endian page headers, sRGB or black colour spaces, repeated-row compression, and pixel-level PackBits encoding

Duplex applies to PostScript, PCL, and PWG; PDF_PRINT_STREAM_TUMBLE requires duplex and selects short-edge binding; PJL is rejected for other formats and monochrome is rejected for vector formats

PCL and PWG rasterise each page through the selected renderer, so applications can select an available non-GDI renderer before export; the method itself does not use a printer driver, printer object, or spooler

LastErrorCode is 120 for invalid arguments or format combinations and 523 when rendering, conversion, or output fails; LastRenderError contains additional detail

See also

RenderPagesToPrintString, RenderPagesToPrintFile, SelectRenderer