Name

move_page_before -- move a page to a new location in the page order

Synopsis

bool move_page_before ( int movepage, int markerpage )

Description

This function is used to alter the order in which pages will appear in the resultant PDF file. This function in no way changes which objects are painted to the pages

movepage is moved in the page order to appear immediately prior to markerpage. The remaining pages in the page order are adjusted so that no gaps result.

The function returns true apon success, false if the move could not be accomplished

Examples

Create five pages and then move page 4 in front of page 2.

$page1 = $pdf->new_page("letter");
$page2 = $pdf->new_page("letter");
$page3 = $pdf->new_page("letter");
$page4 = $pdf->new_page("letter");
$page5 = $pdf->new_page("letter");
$pdf->move_page_before($page4, $page2);

See Also

History

The ability to reorder pages was added in version 1.13 but did not work properly until version 1.14.

Bugs

None known