SaveRangeToFile
IPDFDocument4 :: General document management :: Common

See Also Example
Collapse All

This method saves a new PDF document that will contain specified pages only.

Syntax

HRESULT SaveRangeToFile (
BSTR name,
LONG startPageIndex,
LONG endPageIndex,
VARIANT_BOOL autolaunch
)
Parameters
name
Name of the file

startPageIndex
The index of a start page

endPageIndex
The index of an end page

autolaunch
If VARIANT_TRUE, then the file saved will be opened in the default PDF viewer.

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Example

Saving to a File

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.SetLicenseData('demo', 'demo');

{ Here we open some PDF document. }
PDF.Open('some.pdf', '');

{ Let's assume that this PDF has 10 pages }
PDF.SaveRangeToFile('part1.pdf', 0, 4, false);
PDF.SaveRangeToFile('part2.pdf', 5, 9, false);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->SetLicenseData("demo", "demo");

// Here we open some PDF document.
PDF->Open("some.pdf", "");

// Let's assume that this PDF has 10 pages
PDF->SaveRangeToFile("part1.pdf", 0, 4, false);
PDF->SaveRangeToFile("part2.pdf", 5, 9, false);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.SetLicenseData("demo", "demo");

// Here we open some PDF document.
PDF.Open("some.pdf", "");

// Let's assume that this PDF has 10 pages
PDF.SaveRangeToFile("part1.pdf", 0, 4, false);
PDF.SaveRangeToFile("part2.pdf", 5, 9, false);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.SetLicenseData "demo", "demo"

' Here we open some PDF document.
PDF.Open "some.pdf", ""

' Let's assume that this PDF has 10 pages
PDF.SaveRangeToFile "part1.pdf", 0, 4, false
PDF.SaveRangeToFile "part2.pdf", 5, 9, false

See Also

Reference