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 - Resize A1 and A0 pages to A4
  FAQ FAQ  Forum Search   Register Register  Login Login

Resize A1 and A0 pages to A4

 Post Reply Post Reply
Author
Message
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Topic: Resize A1 and A0 pages to A4
    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.

Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 15 at 8:30AM
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
Back to Top
erico View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24 Sep 14
Location: Minnesota USA
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote erico Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 15 at 4:45PM
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 15 at 7:46PM
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
Back to Top
erico View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24 Sep 14
Location: Minnesota USA
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote erico Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 15 at 7:50PM
Doc for DrawCapturedPage says left, top, width, height.

DrawRotatedCapturedPage uses left, bottom, width, height, angle

I think my numbers are correct.
Eric O
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 15 at 7:39AM
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (1) Thanks(1)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 15 at 8:32AM
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
Back to Top
erico View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24 Sep 14
Location: Minnesota USA
Status: Offline
Points: 51
Post Options Post Options   Thanks (1) Thanks(1)   Quote erico Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 15 at 1:31PM
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
Back to Top
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 15 at 1:09AM
Thanks guys,  DrawCapturedPage(0, 842, 595, 842) was what I needed.
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 15 at 1:50AM
Nice to hear You solved a problem.

Can you use GetOrigin() to say us which Origin you are using just before using DrawCaptredPage.


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
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