CombinePageRanges

Workflow data tools, ActiveX, DLL

Description

Combines two page selections with a union, intersection or difference and returns the resulting page list

Syntax

ActiveX

Function PDFlib::CombinePageRanges(LeftRangeList As String, RightRangeList As String, Operation As Long, FirstPage As Long, LastPage As Long) As String

DLL

const wchar_t* DLCombinePageRanges(int InstanceID, const wchar_t* LeftRangeList, const wchar_t* RightRangeList, int Operation, int FirstPage, int LastPage);
const char* DLCombinePageRangesA(int InstanceID, const char* LeftRangeList, const char* RightRangeList, int Operation, int FirstPage, int LastPage);

Parameters

InstanceIDLibrary instance returned by DLCreateLibrary
LeftRangeListFirst page selection
RightRangeListSecond page selection
Operation0 for union, 1 for intersection or 2 for difference (left pages not in the right selection)
FirstPageFirst valid page number, usually 1; also the value of the first keyword
LastPageLast valid page number, usually the document page count; also the value of the last keyword and the base of r reverse offsets

Return values

Returns a borrowed string that stays valid until a later call on the same instance; copy it at once, using DLStringResultLength for the wide function or DLAnsiStringResultLength for the ANSI function. A successful empty result is a valid empty string. Nil means the input was rejected; call GetWorkflowToolsError for the reason. The result is a comma-separated page list without repeats and may be empty

Remarks

Results keep the order of the left selection; a union appends new right-side pages in their original order

Both selections use the syntax described for ExpandPageRanges, including explicit lists it returns

The ANSI function converts text using the instance's SetAnsiMode setting; use UTF-8 mode for non-ASCII data

ActiveX exposes this method on IPDFlibrary24; obtain it with CoPDFlibrary.CreateEditionTools24 or query the default interface of PDFlibAX 4.74 or later

All editions include these functions. Failed ActiveX calls return an empty string, 0 or Empty and record the reason for GetWorkflowToolsError. The C#, VB.NET and Visual C++ WorkflowTools examples in the DLL and ActiveX demo folders show a complete request, page plan and rollback workflow

See also

Workflow data tools · Virtual file registry · GetWorkflowToolsError