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 - Set the current transformation matrix
  FAQ FAQ  Forum Search   Register Register  Login Login

Set the current transformation matrix

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


Joined: 25 Sep 09
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote tonyedgecombe Quote  Post ReplyReply Direct Link To This Post Topic: Set the current transformation matrix
    Posted: 17 Dec 13 at 12:52PM
Is there a way to set the current transformation matrix so that all subsequent drawing operations are transformed.
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: 18 Dec 13 at 8:57AM
Basically the Draw functions add drawing commands to the end of the currently select contentstream.  You can use feature to create your own content stream, see the transformation matrix and start using it.

The quickest and easiest might be to use the following functions.

QP.NewContentStream

QP.SaveState    // saves the current drawing state including transformation matrix.

QP.SetContentStreamFromString(' 10 0 0 10 141.7323 572.5984 cm ');

.... do your drawing here.  Can use any QPL drawing function but it will be affected by the transformation matrix of cours.

QP.LoadState    // restores to original transformation matrix.


Andrew.
Back to Top
tonyedgecombe View Drop Down
Beginner
Beginner


Joined: 25 Sep 09
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote tonyedgecombe Quote  Post ReplyReply Direct Link To This Post Posted: 19 Dec 13 at 1:14PM
Thanks for that.

I had to replace:
QP.SetContentStreamFromString(' 10 0 0 10 141.7323 572.5984 cm ');

with
QP.SetContentStreamFromString(' q 10 0 0 10 141.7323 572.5984 cm ');


The SaveState method wasn't inserting the q operator, I'm not sure if this is because I'm doing something wrong or if it's a bug.

Tony
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: 19 Dec 13 at 1:42PM
Tony,

The SetContentStreamFromString will replace the entire content stream contents so yes the 'q' is needed and the call to SaveState should be removed.  The 'Q' is appended correctly with the QP.LoadState call and should be used to balance out the initial 'q' - savestate operator.

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