Normalize PDF Pages

In some cases a PDF document contains pages with different page sizes. For example if the document was merged together out of a couple documents.

With the function set_pagesize it is possible to bring all pages of a document to the same width or lenght. The aspect ratio will be kep.

The API is pretty simple. Just see a sample below.


Dim pdf
Dim PWidth
Dim i

InFile = "d:\mymerged-notok.pdf"
OutFile = "d:\out.pdf"
PWidth = 595                                    'A4

Set pdf = CreateObject("aloahapdf.edit")

If pdf.load_pdf_to_mem(CStr(InFile)) = true Then
     pages = pdf.pdfpages
     If pages>0 Then
          For i = 1 to pages
                    Call pdf.set_pagesize(CDbl(PWidth), CLng(i), false) 
          Next
          If pdf.save_pdf_to_file(CStr(OutFile)) = true Then
     End If
     Call pdf.unload_pdf_from_mem
End If 

Set pdf = nothing


Having problems with above sample? Please do not hesitate to contact us via the webform below.



Company
Contact Person  
E-Mail
Telephone
Fax
Comment:

Please enter the code shown on the left in the following field: (This is to prevent automatic spammers)


Aloaha Software / Knowledge Base / PDF SDK / Normalize Pages
create PDF Software

Normalize Pages

Any questions?
Aloaha Software - Software Development / PDF SDK / Normalize Pages / Fix Width / Height
ProductsKnowledge BaseShopSupportPress
Deutsche VersionEnglish version