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 creates a new PDF page, appending it to the end of the PDF document. It does not set the new page as current.

Syntax

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

Remarks

To add a new page and make it current, use the NewPage method.

Example

Adding a Page

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
font := PDF.AddFont('Arial', false, false, false, false, fcDefault);
PDF.UseFont(font, 10);
PDF.ShowTextAt(10, 10, 'This is the 1st page.');
PDF.AddPage;
PDF.ShowTextAt(10, 20, 'This is still the 1st page.');
PDF.CurrentPage := 1;
PDF.UseFont(font, 10);
PDF.ShowTextAt(10, 10, 'This is the 2nd page.');
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long font = PDF->AddFont("Arial", false, false, false, false, fcDefault);
PDF->UseFont(font, 10);
PDF->ShowTextAt(10, 10, "This is the 1st page.");
PDF->AddPage();
PDF->ShowTextAt(10, 20, "This is still the 1st page.");
PDF->CurrentPage = 1;
PDF->UseFont(font, 10);
PDF->ShowTextAt(10, 10, "This is the 2nd page.");
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long font = PDF.AddFont("Arial", false, false, false, false, FontCharset.fcDefault);
PDF.UseFont(font, 10);
PDF.ShowTextAt(10, 10, "This is the 1st page.");
PDF.AddPage();
PDF.ShowTextAt(10, 20, "This is still the 1st page.");
PDF.CurrentPage = 1;
PDF.UseFont(font, 10);
PDF.ShowTextAt(10, 10, "This is the 2nd page.");
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
font = PDF.AddFont("Arial", False, False, False, False, 1) 'fcDefault
PDF.UseFont font, 10
PDF.ShowTextAt 10, 10, "This is the 1st page."
PDF.AddPage
PDF.ShowTextAt 10, 20, "This is still the 1st page."
PDF.CurrentPage = 1
PDF.UseFont font, 10
PDF.ShowTextAt 10, 10, "This is the 2nd 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