RenderPageToClipboard

Rendering and printing

Description

This function is only available on Windows. It renders a page from the selected document and places the result on the Windows clipboard in the format(s) indicated by the Format parameter.

Use cfMetafile to place an enhanced metafile (CF_ENHMETAFILE) for vector paste into Office, Illustrator, and other vector-capable consumers; cfBitmap to place a device-independent bitmap (CF_DIB) for paste into Paint and bitmap-only consumers; cfText to place the page's Unicode text (CF_UNICODETEXT) extracted via the same engine as GetPageText; and cfAll to place all three simultaneously so the target application can pick the richest format it supports.

The clipboard is opened, emptied, and one or more handles are transferred to it. The currently selected page is preserved even when the text format selects the target page internally for extraction. On non-Windows platforms the function always returns 0.

Syntax

Delphi

Function TPDFlib.RenderPageToClipboard(DPI: Double; Page: Integer; Format: TPDFlibClipboardFormat): Integer;

Parameters

DPIThe DPI to use when rendering the page. Affects raster (cfBitmap) and metafile frame sizing; the text format (cfText) is DPI-independent
PageThe page number to render
FormatcfMetafile = CF_ENHMETAFILE vector; cfBitmap = CF_DIB bitmap; cfText = CF_UNICODETEXT extracted text; cfAll = all three at once

Return values

0The clipboard could not be opened, or no format was placed successfully
1At least one requested format was placed on the clipboard