Components for Developers
© 2000-2008, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Common
Collapse All

This method opens an existing PDF document, reads and parses its contents.

Syntax

HRESULT Open (
BSTR fileName,
BSTR password
)
Parameters
fileName
Path to the PDF document to be opened

password
String containing the password

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

Remarks

This method clears all internal data before opening a document. If you want to save a previously created document, call SaveToFile or GetBuffer first.

When the document is opened, the current page will be the last page of
the existing PDF document.

When the document is opened, all of its properties (Author, Producer, Creator, Title, Subject and Keywords) are saved. You can change them later as needed.

Example

Opening an Existing PDF Document

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.Open('one.pdf', '');
PDF.NewPage;
font := PDF.AddFont('Arial', false, false, false, false, fcDefault);
PDF.UseFont(font, 10);
PDF.ShowTextAt(10, 10, 'This is a new page.');
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->Open("one.pdf", "");
PDF->NewPage();
long font = PDF->AddFont("Arial", false, false, false, false, fcDefault);
PDF->UseFont(font, 10)
PDF->ShowTextAt(10, 10, "This is a new page.");
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.Open("one.pdf", "");
PDF.NewPage();
long font = PDF.AddFont("Arial", false, false, false, false, FontCharset.fcDefault);
PDF.UseFont(font, 10)
PDF.ShowTextAt(10, 10, "This is a new page.");
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.Open "one.pdf", ""
PDF.NewPage
font = PDF.AddFont("Arial", False, False, False, False, 1) 'fcDefault
PDF.UseFont font, 10
PDF.ShowTextAt 10, 10, "This is a new page."
PDF.SaveToFile "test.pdf", true
Set PDF = nothing

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2008, Two Pilots