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 - DrawCapturedPage is Drawing off artboard
  FAQ FAQ  Forum Search   Register Register  Login Login

DrawCapturedPage is Drawing off artboard

 Post Reply Post Reply
Author
Message
dptulk View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Feb 12
Location: Ohio
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote dptulk Quote  Post ReplyReply Direct Link To This Post Topic: DrawCapturedPage is Drawing off artboard
    Posted: 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member


Joined: 29 Mar 11
Status: Offline
Points: 77
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
dptulk View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Feb 12
Location: Ohio
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote dptulk Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post 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.

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

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dptulk View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Feb 12
Location: Ohio
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote dptulk Quote  Post ReplyReply Direct Link To This Post Posted: 24 Feb 12 at 4:50PM
That did the trick gentlemen...  Thank you.
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