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!
Resize A1 and A0 pages to A4 |
Post Reply |
Author | |
CrazyTIm
Team Player Joined: 21 Aug 11 Location: Australia Status: Offline Points: 29 |
Post Options
Thanks(0)
Posted: 18 May 15 at 6:34AM |
Hi All, I am looking for a way to resize all pages of a pdf (containing some A1, and some A0 pages) to A4.
I have experimented with: SetPageDimensions NormalizePage DrawCapturedPage but no luck yet. Any help would be appreciated.
|
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Did you use CapturePage or CapturePageEx ?
can you post code snippet ?
|
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
erico
Senior Member Joined: 24 Sep 14 Location: Minnesota USA Status: Offline Points: 51 |
Post Options
Thanks(0)
|
CapturePage/CapturePageEx should not matter unless the input file mediabox is the wrong size. 'Ex' allows you to use a choice of boxes for capturing.
I would do something like the following to resize to A4: // First find out how many pages you need to process: inputDoc=LoadFromFile(documentname,password) pagesToProcess = PageCount() // Create your "sized" template with the correct number of pages sizedDoc = NewDocument() SetPageSize("A4") InsertPages(pagesToProcess -1 // We got one page "for free" // Combine the documents so CapturePage can be used MergeDocument(inputDoc) // Append the document so CapturePage can be used currentPage = 1 while (currentPage <= pagesToProcess) { CapturePage(pagesToProcess+1) // This deletes the page from the document SelectPage(currentPage) DrawCapturedPage(0, 842, 595, 842) // This draws the captured page at A4 size regardless of its original dimension currentPage += 1 } SaveToFile() |
|
Eric O
|
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
I think you are using this:
DrawCapturedPage(0, 842, 595, 842) in a wrong way. I see you are using default value for SetOrigin so I think you need to use this: DrawCapturedPage(0, 0, 595, 842) |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
erico
Senior Member Joined: 24 Sep 14 Location: Minnesota USA Status: Offline Points: 51 |
Post Options
Thanks(0)
|
Doc for DrawCapturedPage says left, top, width, height.
DrawRotatedCapturedPage uses left, bottom, width, height, angle I think my numbers are correct. |
|
Eric O
|
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
I see you are using
DrawCapturedPage not DrawRotatedCapturedPage ? EDIT: ah I see SetOrigin default is 0 = Bottom left (default) try to change 1 = Top left and then DrawCapturedPage(0,0,... Edited by mLipok - 20 May 15 at 8:24AM |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(1)
|
btw.
From Reference guide: DrawCapturedPage Top >> The co-ordinate of the top edge of the destination area I think this is independently your SetOrigin settings. If I'am right, then I submit request to Debenu for more clearly describe this in the documentation. |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
erico
Senior Member Joined: 24 Sep 14 Location: Minnesota USA Status: Offline Points: 51 |
Post Options
Thanks(1)
|
I have not tested the SetOrigin, but I do believe you are correct in stating it does not affect the values for DrawCapturedPage.
In any case, I think CrazyTim can get his job done with this information and a minimal amount of experimentation. Good luck! |
|
Eric O
|
|
CrazyTIm
Team Player Joined: 21 Aug 11 Location: Australia Status: Offline Points: 29 |
Post Options
Thanks(0)
|
Thanks guys, DrawCapturedPage(0, 842, 595, 842) was what I needed.
|
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Nice to hear You solved a problem. |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
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