GdPicturePDF.DrawImage not drawing on coordinates after page rotate

Discussions about PDF management.
Post Reply
Trevor
Posts: 5
Joined: Wed Nov 29, 2017 7:29 pm

GdPicturePDF.DrawImage not drawing on coordinates after page rotate

Post by Trevor » Wed Nov 29, 2017 7:45 pm

All,

The company I work for has support with GdPicture, but I figured I would post here first in hopes to finding out a fix instead of creating a support ticket. We recently upgraded from V9 to GdPicture14.Net and so far so good! Recently we received a report that when user's rotate a page and then draw an image on the page (signature) it does not draw it in the correct place.

For example:
  • User loads a pdf and rotates a page left: oPDFDoc.RotatePage(90)
  • Now user uses selection mode to select an area to apply their image, upon mouse up we draw this image.
It seems if the user does not rotate the page, the image is drawn exactly where we want it, only when the page has been rotated. We didn't have this issue on the older version, it worked just fine.

Is there something that has to be done after a rotate in order to draw an image on the page? On another note, it seems it's trying to draw the image at the original location before the page was rotated, like the old orientation...

Trevor
Posts: 5
Joined: Wed Nov 29, 2017 7:29 pm

Re: GdPicturePDF.DrawImage not drawing on coordinates after page rotate

Post by Trevor » Thu Nov 30, 2017 4:37 pm

Upon investigation, it seems that the

Code: Select all

GetPageWidth()
and

Code: Select all

GetPageHeight()
doesn't get updated when a page has been rotated according to
https://www.gdpicture.com/guides/gdpicture/Gd ... idth.html

I may believe this is the issue we are seeing. As when the page is rotated the same width and height are set. What is the fix to get around this?

rlagrange
Posts: 30
Joined: Tue May 02, 2017 5:51 pm

Re: GdPicturePDF.DrawImage not drawing on coordinates after page rotate

Post by rlagrange » Thu Nov 30, 2017 5:05 pm

rotation is a pain to work with. You should yourself be aware of oGdPicturePdf.GetPageRotation() and project every coordinates, including GetRect on selection, etc...

Trevor
Posts: 5
Joined: Wed Nov 29, 2017 7:29 pm

Re: GdPicturePDF.DrawImage not drawing on coordinates after page rotate

Post by Trevor » Thu Nov 30, 2017 5:29 pm

rlagrange wrote:
Thu Nov 30, 2017 5:05 pm
rotation is a pain to work with. You should yourself be aware of oGdPicturePdf.GetPageRotation() and project every coordinates, including GetRect on selection, etc...
It is a pain, we use

Code: Select all

GetPageRotation()
and

Code: Select all

GetRect()
, but problem still exists. I am not sure what changed with this between the V9 and Gd14, but it was working just fine.

I am curious of what a work around would be... or if this issue will be addressed?

Thanks for your input!

Trevor
Posts: 5
Joined: Wed Nov 29, 2017 7:29 pm

Re: GdPicturePDF.DrawImage not drawing on coordinates after page rotate

Post by Trevor » Mon Dec 04, 2017 8:43 pm

All,

This issue has been figured out, thanks to Gabriella!

Need to call

Code: Select all

GdPicturePDF.NormalizePage()
and it work's just fine!


Thank You All!

reisrf
Posts: 27
Joined: Thu May 28, 2015 4:30 pm

Re: GdPicturePDF.DrawImage not drawing on coordinates after page rotate

Post by reisrf » Fri Jul 27, 2018 9:43 pm

Thanks for this info. I had the same issue and this post helped me.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest