Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Change papersize on existing PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Change papersize on existing PDF

 Post Reply Post Reply
Author
Message
PeterL View Drop Down
Beginner
Beginner


Joined: 16 Mar 16
Location: Denmark
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote PeterL Quote  Post ReplyReply Direct Link To This Post Topic: Change papersize on existing PDF
    Posted: 16 Mar 16 at 11:51AM
Hi,
 
 I'm trying to change the paper size on an existing PDF file from "A4" to "Letter" and have used the PDF library (version 12.12)  (VBScript) for this purpose - using the CapturePage function. However, it looks like this function does not capture comments and bookmarks.
 Any suggestion on how to solve this ?
 
Thanks.
Partial code
----------------------------------------------------------
 
Call QP.LoadFromFile("C:\Development\PDF\blankcrf.pdf","" )
Call QP.SetOrigin(1)
Dim  np' No of pages
np = QP.PageCount() 
WScript.Echo("No Pages.."+CStr(np))

'
' Process all pages
'
Dim pw   'Page Width
Dim ph   'Page Height
Dim hb   'Horiz border
Dim vb   'Vertz Border
Dim pi   'Page Id
Dim cp   'Captured Page

Dim ScaleFactor
ScaleFactor = 0.9

For oCount = 1To np

  WScript.Echo("Processing.."+CStr(oCount))
  
  Call QP.SelectPage(1)
  pw = QP.PageWidth()
  ph = QP.PageHeight()

  WScript.Echo(CStr(pw)+":"+CStr(ph))
  
  hb = pw * (1.0 - scaleFactor) / 2
  vb = ph * (1.0 - scaleFactor) / 2

  cp = QP.CapturePage(1)
  Call QP.SetPageSize("Letter")
  pi = QP.NewPage() 
  Call QP.SetPageSize("Letter")
  Call QP.SetPageDimensions(pw, ph)
  Call QP.DrawCapturedPage(cp, hb, vb*2, pw - 2 * hb, ph)

Next


Call QP.SaveToFile("C:\Development\A4LetterPDF\resized.pdf")

 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 17 Mar 16 at 9:24PM
Hi Peter,

i've found older posts regarding similar issues with lost internal links. 
Perhaps it's still a prob.
Perhpas posts like this could be a help:
http://www.quickpdf.org/forum/usingtwice-drawrotatedcapturedpage-on-a-new-page_topic2930.html
Perhaps a NormalizePage before capture can help, too?

Cheers and welcome here,
Ingo

Cheers,
Ingo

Back to Top
BobW View Drop Down
Senior Member
Senior Member


Joined: 27 Feb 13
Location: Minnesota
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote BobW Quote  Post ReplyReply Direct Link To This Post Posted: 23 Mar 16 at 6:39PM
Check out this post:
http://www.quickpdf.org/forum/taking-3-inches-off-the-bottom_topic3170.html


Back to Top
PeterL View Drop Down
Beginner
Beginner


Joined: 16 Mar 16
Location: Denmark
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote PeterL Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 16 at 12:01PM
Unfortunately, all the comments are upside down after applying your suggestion.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 16 at 1:11PM
so it seems to me that the relevant pdf was processed using "rotate"?
Try NormalizePage before ...
http://www.debenu.com/docs/pdf_library_reference/NormalizePage.php

Cheers,
Ingo

Back to Top
BobW View Drop Down
Senior Member
Senior Member


Joined: 27 Feb 13
Location: Minnesota
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote BobW Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 16 at 10:41PM
The post I reference needed to take 3 inches off the bottom of the page.  This required rotating the page, cutting three inches off the top, then rotating it back.  If you take out the rotation part it should do what you want.  The key, as Ingo points out, is NormalizePage.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store