Print Page | Close Window

Taking 3 inches off the bottom

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3170
Printed Date: 28 Apr 24 at 4:56AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Taking 3 inches off the bottom
Posted By: BobW
Subject: Taking 3 inches off the bottom
Date Posted: 28 Aug 15 at 8:50PM
I have a PDF that is legal sized.  I need to make it letter by lopping off the bottom 3 inches.  I've found several threads about using CapturePage and DrawCapturedPage but the problem is that no matter how I adjust the arguments, the result is always the top three inches of the page being removed rather than the bottom 3.

I'm doing something like this:

LoadFromFile
NewPage
CapturePage 2
SetPageSize "Letter"
DrawCapturedPage CapturedPageID, 0,0,PageWidth(),PageHeight()
SaveToFile

No matter what I put in DrawCapturedPage to replace the 0's, the page never moves.  If I omit the SetPageSize, it looks fine, it's just that it's still legal.  I've tried NormalizePage, SetOrigin, and stuff like that but it doesn't change anything.

Is there any way to take 3 inches off the bottom?



Replies:
Posted By: Ingo
Date Posted: 30 Aug 15 at 10:17PM
Hi Bob,

you should read the description about function "SetOrigin":
http://www.debenu.com/docs/pdf_library_reference/SetOrigin.php" rel="nofollow - http://www.debenu.com/docs/pdf_library_reference/SetOrigin.php

Cheers,
Ingo



-------------
Cheers,
Ingo



Posted By: BobW
Date Posted: 31 Aug 15 at 5:51PM
I did read the description about that function, and I tried all the possible values for it with no change in the result.  I also did a search on DrawCapturedPage in the forum and found this note:

http://www.quickpdf.org/forum/resize-a1-and-a0-pages-to-a4_topic3117_post12505.html?KW=drawcapturedpage#12505

which indicates that SetOrigin has no effect on DrawCapturedPage.

Is this a bug in DrawCapturedPage or is there some other way to turn a Legal PDF into a Letter PDF by removing the bottom 3 inches?


Posted By: erico
Date Posted: 08 Sep 15 at 3:40PM
I'm pretty sure the SetPageSize is cropping off the text. Drawing a captured page in a smaller area only reduces it -- it does not trim the edges. I would guess you need to look at SetCropBox, or the slightly more generic SetPageBox.


-------------
Eric O


Posted By: BobW
Date Posted: 03 Dec 15 at 5:32PM
I finally came up with a solution to this problem:

LoadFromFile

For ii = 1 to PageCount
   SelectPage ii
   RotatePage 180
   NormalizePage 0
   SetPageSize "Letter"
   RotatePage 180
   NormalizePage 0
next ii

SaveToFile

I'm not sure that the last NormalizePage is necessary.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk