void addNewPage(int PageWidth, int PageHeight)

Closes the current page and adds a new one to the PDF document. The size of the page will be defined by the parameters PageWidth and PageHeight. Given values will also overwrite the properties for the current page with the same name.

If PageWidth is larger than PageHeight then the page will be displayed in landscape mode otherwise in portrait mode. The page size and orientation can be set individually for every added page by using that method.

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// create new PDF_Writer object
PDF_Writer.Writer PDF = new PDF_Writer.Writer();
 
// draw a sample string
PDF.drawString("Page 1 with default size", 50, 50);
 
// add new page in landscape mode
PDF.addNewPage(841, 595);
 
// draw another sample string on new page
PDF.drawString("Page 2 in landscape mode", 50, 50);
 
// save PDF document to file system
PDF.save(@"C:\PDF_Writer\test.pdf");