SetPageSize

Description

Sets the page size of the PDFPage object.

Applies to

PDFPage object

Syntax

SetPageSize(double width, double height)
SetPageSize(PDFPageSize PageSize)

Argument

Description

height

The height of the page of the PDFPage object. The unit is point (pt).

width The width of the page of the PDFPage object. The unit is point (pt).
PageSize

A value of the PDFPageSize enumerated datatype specifying the standard page sizes. Values are:

  • PDFPage_A1! -- Width 59.4cm (1684 points), Height 84.0cm (2380 points)

  • PDFPage_A2! -- Width 52.0m (1190 points), Height 59.4cm (1684 points)

  • PDFPage_A3! -- Width 29.7cm (842 points), Height 42.0cm (1190 points)

  • PDFPage_A4! -- Width 21.0cm (595 points), Height 29.7cm (842 points)

  • PDFPage_Letter! -- Width 21.59cm (612 points), Height 27.94cm (792 points)

  • PDFPage_Legal! -- Width 21.59cm (612 points), Height 35.56cm (1008 points)

The following page sizes are not included in PDFPageSize. You need to manually specify the page width and height:

  • Width 2380 points, and height 3368 points, for the A0 page size

  • Width 421 points, and height 595 points, for the A5 page size

  • Width 297 points, and height 421 points, for the A6 page size

  • Width 501 points, and height 709 points, for the B5 page size

  • Width 1224 points, and height 792 points, for the ledger page size

  • Width 792 points, and height 1224 points, for the 11*17 page size


Return value

None.

Usage

Call the function to set the page size of the PDFPage object.

Examples

This example creates a PDFPage, sets its size, and adds it to a PDF document.

PDFpage lpdf_page
PDFdocument lpdf_doc
PDFtext lpdf_text

lpdf_page = create PDFpage
lpdf_doc = create PDFdocument
lpdf_text = create PDFtext

lpdf_page.setsize(PDFPage_A4!)
lpdf_text.content = "text content"
lpdf_page.addcontent(lpdf_text)

lpdf_doc.addpage(lpdf_page)
lpdf_doc.save("D:\addcontent.pdf")

See also

AddContent

Clone

GetContent

GetContentCount

GetHeight

GetWidth

ImportContent

IndexOf

RemoveContent

SetHeight

SetWidth