Doc Page Property. The current Page ID. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

 

Type Default Read Only Description
[C#] int

[Visual Basic]
Integer
  0 No The current Page ID.

 

   

Notes
 

This property holds the current Page ID. The current page is the one that receives new objects as they are added to the document.

For example the methods AddText, AddLine, AddImage, FrameRect and FillRect all operate on the current page.

When you change the Page property the Pos property is reset to the top left of the current Rect.

Note that the PageNumber property is not the same as the Page property. The Page holds an Object ID typically returned from a call to AddPage. The PageNumber indicates the page using an index ranging between one and the PageCount.

Either the Page or the PageNumber property can be used to set the current page.

If no page is specified the current page is taken to be the first page in the document.

 

   

Example
 

The following example creates a document with two pages and adds text to each of the pages in turn.

[C#]
Doc theDoc = new Doc();
theDoc.FontSize = 96; // big text
theDoc.Page = theDoc.AddPage();
theDoc.AddText("Page One");
theDoc.Page = theDoc.AddPage();
theDoc.AddText("Page Two");
theDoc.Save(Server.MapPath("docpage.pdf"));
theDoc.Clear();

[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.FontSize = 96 ' big text
theDoc.Page = theDoc.AddPage()
theDoc.AddText("Page One")
theDoc.Page = theDoc.AddPage()
theDoc.AddText("Page Two")
theDoc.Save(Server.MapPath("docpage.pdf"))
theDoc.Clear()


docpage.pdf