Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Common
Collapse All

This method creates a new PDF page, appends it to the end of the PDF document, and makes it current.

Syntax

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

Remarks

When the page is added to the PDF document and set as current, the built-in font "Helvetica" (8pt) is used by default. Call the UseFontmethod to change the page's current font.

To add a new page without making it current use AddPage.

Example

Adding a New 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.NewPage;
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->NewPage();
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.NewPage();
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.NewPage
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-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots