ExtractFilePages

Document manipulation, Extraction, Page manipulation

Description

Extracts ranges of pages from a PDF document on disk and places the extracted pages into a new PDF document.

The ExtractFilePagesEx function is able to produce smaller output files using a cross reference stream instead of a cross reference table.

Syntax

Delphi

function TPDFlib.ExtractFilePages(Const InputFileName, Password, OutputFileName, RangeList: WideString): Integer;

ActiveX

Function PDFlib::ExtractFilePages(InputFileName As String, Password As String, OutputFileName As String, RangeList As String) As Long

DLL

int DLExtractFilePages(int InstanceID, wchar_t * InputFileName, wchar_t * Password, wchar_t * OutputFileName, wchar_t * RangeList);

Parameters

InputFileNameThe path and name of the document that contains the pages to extract.
PasswordThe password to use when opening the document
OutputFileNameThe path and name of the document to create containing the extracted pages.
RangeListThe pages to extract, for example "10,15,18-20,25-35". Invalid characters will be ignored. Reversed page ranges such as "5-1" will be accepted. Duplicate page numbers will be accepted but if a change is made to such a page the same changes will appear on the duplicate pages. The list of pages will not be sorted so the resulting document will have the pages in the specified order.

Return values

0The pages could not be extracted. Use the LastErrorCode function to determine the cause of the failure.
1The pages were extracted successfully