StitchPagesSideBySide

Page manipulation

Description

Places two existing pages next to each other on a new, wider page. Both source pages are captured into vector Form XObjects and drawn left and right, scaled to the requested TargetHeight while preserving their individual aspect ratios. A Gap is inserted between them.

The new page is appended to the document; both source pages are captured and hidden. The new page's width is automatically computed as Page1ScaledWidth + Gap + Page2ScaledWidth.

Syntax

Delphi

Function TPDFlib.StitchPagesSideBySide(Page1, Page2: Integer; Gap, TargetHeight: Double): Integer;

Parameters

Page1The 1-based page number placed on the left (consumed and hidden)
Page2The 1-based page number placed on the right (consumed and hidden); must differ from Page1
GapHorizontal space between the two pages on the new sheet, in current measurement units
TargetHeightThe height of the new output page; each source page is scaled (preserving aspect ratio) to this height

Return values

0The stitch could not be performed (invalid pages, same page specified twice, or non-positive TargetHeight)
>= 1The 1-based page number of the newly created side-by-side page