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!
![]() |
Change papersize on existing PDF |
Post Reply
|
| Author | |
PeterL
Beginner
Joined: 16 Mar 16 Location: Denmark Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Topic: Change papersize on existing PDFPosted: 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 = 1 To 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") |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
BobW
Senior Member
Joined: 27 Feb 13 Location: Minnesota Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 Mar 16 at 6:39PM |
|
Check out this post:
http://www.quickpdf.org/forum/taking-3-inches-off-the-bottom_topic3170.html |
|
![]() |
|
PeterL
Beginner
Joined: 16 Mar 16 Location: Denmark Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 Mar 16 at 12:01PM |
|
Unfortunately, all the comments are upside down after applying your suggestion.
|
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
BobW
Senior Member
Joined: 27 Feb 13 Location: Minnesota Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store