DynaPDF - How to Resizing PDF Pages ?

I would need to be able to resize a PDF document which I am able to but I still do not know how to scale the contents to fit the new page size.

Currently my codes are as follows

[code] call pdfexport.openimportfile(fx,0,"")
call pdfexport.ImportPDFFile(pdfexport.GetPageCount+1,1.0,1.0)

      // do resizing of PDF pages
      
      if mresizingmethod <> "As Is" then
        
        
        dim px,py as integer
        
        py = pdfexport.getpagecount 
        
        for px = 1 to py
          call pdfexport.editpage(px)
          call pdfexport.SetPageheight(newheight)
          call pdfexport.SetPageWidth(newwidth)
          call pdfexport.endpage
          
        next 
        
        
      end if 
      
      call pdfexport.closeimportfile [/code]

I did consider using the ImportPDFFile with scaling but I got no idea which ImportFlag to use and also how do I get the yet imported pages dimensions to work out the scaling ratios as each page may be of a different size.

Thank you

if you use kifImportAsPage flag, you get real pages and size doesn’t change.

If you use ImportPDFPage without the kifImportAsPage flag in the import flags, you get a template number. That template can than be placed in smaller size.

So you create a new page and place the existing one scaled down with PlaceTemplate or PlaceTemplateEx.

[quote=283510:@Christian Schmitz]if you use kifImportAsPage flag, you get real pages and size doesn’t change.

If you use ImportPDFPage without the kifImportAsPage flag in the import flags, you get a template number. That template can than be placed in smaller size.

So you create a new page and place the existing one scaled down with PlaceTemplate or PlaceTemplateEx.[/quote]

Thank you so much. That did the trick.