GetPageSize

Description

Gets the size of the specified page in a PDF document.

Applies to

PDFDocExtractor object

Syntax

long GetPageSize(long index, ref long width, ref long height)

Argument

Description

index

The index of the page.

width

The width of the page at the index.

height

The height of the page at the index.


Return value

Long. Returns 1 if it succeeds and -1 if it fails. For more errors, see the Error Codes.

Examples

This example gets the size of the first page in the extract.pdf.

PDFdocument lpdf_doc
PDFpage lpdf_page
long ll_open,index
double ll_width,ll_height

PDFDocExtractor lpdf_docExt
lpdf_docExt = create PDFDocExtractor
lpdf_doc = create PDFdocument
lpdf_page = create PDFpage

ll_open = lpdf_docExt.open("extract.pdf" )
lpdf_docExt.getpagesize( 1,ll_width,ll_height )
//messagebox("Get the size of the first page:","width="+string(ll_width)+",height="+string(ll_height))

lpdf_docExt.close()

lpdf_page.importcontent( "extract.pdf", 1, 100, 100, ll_width, ll_height)
lpdf_doc.addpage( lpdf_page)

lpdf_doc.save( "D:\save\getPagesize.pdf")

See also

ExtractAllAttachments

ExtractAttachmentFile

GetAttachmentList

GetPageCount

Open