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 - CapturePage and DrawCapturedPage creating upside d
  FAQ FAQ  Forum Search   Register Register  Login Login

CapturePage and DrawCapturedPage creating upside d

 Post Reply Post Reply
Author
Message
champagnecharly View Drop Down
Beginner
Beginner


Joined: 12 Apr 08
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote champagnecharly Quote  Post ReplyReply Direct Link To This Post Topic: CapturePage and DrawCapturedPage creating upside d
    Posted: 16 Aug 11 at 1:15AM


Hello,

Where am i going wrong? Is it lack of sleep that stops me seeing the wood for the trees?

Basically using capture I get an upside down mirror image of the original page. 


    Dim CapturedPageID, OptionalContentGroupID, pagecount

pagecount= qp.pagecount
    
     OptionalContentGroupID = qp.NewOptionalContentGroup("NonPrintable")
  Call qp.SetOptionalContentGroupPrintable(OptionalContentGroupID, 0)
  
  CapturedPageID = qp.CapturePage(pagecount)
    Call qp.SetCapturedPageOptional(CapturedPageID, OptionalContentGroupID)
        qp.SelectPage (pagecount - 2)

can anybody see what silly mistake I am making?

Thanks 

Back to Top
champagnecharly View Drop Down
Beginner
Beginner


Joined: 12 Apr 08
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote champagnecharly Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 11 at 2:11AM
Seems like maybe the origin is where the problem lies. 
If I try and set origin to 1 and then save file. I then check  using getOrigin... it returns 0.  IS this normal?

Regards
Back to Top
champagnecharly View Drop Down
Beginner
Beginner


Joined: 12 Apr 08
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote champagnecharly Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 11 at 11:50AM
Ok.. so maybe some important info. The pdf is originally created using XSL> FOP. If I recreate each page. i.e loop through each page and append each page to a new page. then using exactly the same formulae. as previously and overlay the relevant pages.. then there are no mirror images.
This would be an ok work around however the bookmark tree references become corrupt/ invalid.
and my links no longer work. 

Any sugestions?
  
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: 17 Aug 11 at 2:30PM
This problem has been fixed by calling QP.NormalizePage().  

Many libraries, when they create the PDF content stream by adding drawing commands, they don't restore the graphics state back to default when they have finished.  For example, if the last object on the page is 90 degree rotated text and their program rotates the coordinate system to draw the text at 90 degrees but doesn't restore the graphics state back to 0 degrees then the next PDF library that wants to add text to the page such as QPL and the DrawText() command will draw the text at 90 degrees without realising.  Page scaling and the origin can also be affected in the same way.  NormalizePage attempts to fix most of these problems by wrapping the content streams with savestate/restore commands.
Back to Top
champagnecharly View Drop Down
Beginner
Beginner


Joined: 12 Apr 08
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote champagnecharly Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 11 at 2:32PM
Thanks Andrew. It certainly fixed the issue. Thank you also for the explanation. 

Regards
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