Type   Default Value   Read Only   Description
XRect Letter Size
[0, 0, 612, 792].
No The current document page size.

 

   
Notes
 
     

This property reflects the size of the current page. It also determines the size of new pages created by the AddPage property. Note that changing the MediaBox does not change the current Rect.

Changing this property will change the size of pages created by subsequent calls to AddPage. However it will not change the size of the pages that have already been created. To change the size of the pages that have already been created you need to use the SetInfo method. For example:

theDoc.SetInfo theDoc.Page, "/MediaBox:Rect", "0 0 200 300"

The default page size is often the one you'll want to use. However it may be that your PDFs are required to conform to a particular page size. See the Page Sizes section for a quick lookup of common page sizes.

 

   
Example
 
     

The following code creates a PDF document containing three different pages each with a different size.

Set theDoc = Server.CreateObject("ABCpdf3.Doc")
theDoc.Page = theDoc.AddPage
theDoc.MediaBox.Width = 300
theDoc.Page = theDoc.AddPage
theDoc.MediaBox.Height = 300

theDoc.Page = theDoc.AddPage
theDoc.Save "c:\docmediabox.pdf"

 

   

 

Browser Based Help. Published by chm2web software.