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!
![]() |
DrawCapturedPage is Drawing off artboard |
Post Reply
|
| Author | |
dptulk
Beginner
Joined: 24 Feb 12 Location: Ohio Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: DrawCapturedPage is Drawing off artboardPosted: 24 Feb 12 at 2:14AM |
|
I have some vb code that I am using to try to imposition some pages. It took me forever to figure it out but the drawcapturedpage command is drawing it far off of the current page. are there any known issues with this? Is there something that I am missing?
Here is the code that I am using: QP.LoadFromFile(SrcFileName, "") Dim numpages As Integer = QP.PageCount Dim pagewidth = QP.PageWidth() Dim pageheight = QP.PageHeight() MsgBox("There are " & numpages & " in the " & pagewidth & " x " & pageheight & " document.") Dim ThisCaptureID = QP.CapturePage(2) QP.NewPage() 'QP.SetPageDimensions(1224, 792) QP.SetPageSize("Tabloid") QP.SetFillColor(1, 1, 0) QP.DrawBox(0, 0, 1224, 792, 1) Dim Capt = QP.DrawCapturedPage(ThisCaptureID, 0, 0, pagewidth, pageheight) MsgBox(Capt) QP.DeletePages(1, numpages) QP.SaveToFile("newfile.pdf") QP = Nothing |
|
![]() |
|
jpbro
Senior Member
Joined: 29 Mar 11 Status: Offline Points: 77 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 Feb 12 at 2:50AM |
|
A PDF origin is the bottom left corner as opposed to the top left as you might intuitively expect.
Try calling QP.SetOrigin 1 to change the origin to the top-left corner before drawing. |
|
![]() |
|
dptulk
Beginner
Joined: 24 Feb 12 Location: Ohio Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 Feb 12 at 3:41AM |
|
So the origin of the source and the origin of the destination are both bottom left? That seems strange. I will give it a shot.
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 Feb 12 at 8:46AM |
|
dptulk is correct.
The origin is located in the bottom left corner and the y axis increases as you go up the page. This is the default for Postscript and PDF. Call QP.SetOrigin(1) just before you call QP.SetPageSize() and it should work well. |
|
![]() |
|
edvoigt
Senior Member
Joined: 26 Mar 11 Location: Berlin, Germany Status: Offline Points: 111 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 Feb 12 at 10:10AM |
|
Hi, I see another small problem. You try to delete all pages. Only because of "PageCount The total number of pages to delete. The value will be automatically adjusted if necessary so that the document is left with at least one page." DeletePages deletes only numpages-1. This potential to come in error, when making the code for more than only test. Cheers, Werner Edited by edvoigt - 24 Feb 12 at 12:55PM |
|
![]() |
|
dptulk
Beginner
Joined: 24 Feb 12 Location: Ohio Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 Feb 12 at 4:50PM |
|
That did the trick gentlemen... Thank you.
|
|
![]() |
|
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