Loading...

GdPicturePDF DrawImage issue and SetAuthor

Support for GdPicturePDF Plugin.

GdPicturePDF DrawImage issue and SetAuthor

Postby blewis » Thu Dec 01, 2011 10:00 am

I came across two issues when putting together my latest project.

The first has to do with DrawImage. I have the origin and units set on my PDF:
Code: Select all
oGdPictureNewPDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
oGdPictureNewPDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitMillimeter)

When I use DrawText everything works just great and the text appears as expected. I was unable to get DrawImage to show the image though. I figured out eventually that the DrawImage method was not honoring the Origin and was using BottomLeft instead, so the image was being drawn off the page. When I specified negative Y units, I was able to get the image to draw in the location I needed, but I could not figure out why it was doing that (not honoring the Origin). Thoughts? It's not critical, since the negative coordinates is a usable workaround, but it seemed weird that Text would draw fine using the TopLeft, but not Image.

Second, a very minor oddity. When using SetAuthor, the value of this method appears in quotation marks in the PDF document properties. So if I do:

Code: Select all
oGdPictureNewPDF.SetAuthor("My Company")

Then I see "My Company" (with the quotes) in the document properties. None of the other properties Set methods have this issue. Just wondering if that was a minor bug.

Thanks,
Bryan
Bryan Lewis
gdPicture 8.5.8 Ultimate
blewis
 
Posts: 20
Joined: Wed May 18, 2011 4:28 am

Re: GdPicturePDF DrawImage issue and SetAuthor

Postby Loïc » Thu Dec 01, 2011 1:17 pm

Hi Bryan,

For the drawImage method you should read the reference guide, especially for the parameters:

DstX

The X destination of the bottom left corner of the bitmap in current unit.
DstY

The Y destination of the bottom left corner of the bitmap in current unit.
Width

Width in current unit
Height

Height in current unit


For the second issue:
Then I see "My Company" (with the quotes) in the document properties

Could you tell me how you can see that ? U
i suppose your PDF reader put the marks itself.

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: GdPicturePDF DrawImage issue and SetAuthor

Postby blewis » Thu Dec 01, 2011 6:23 pm

Loic,

I guess I misunderstood the reference guide. I understood the coordinators represented the bottom left corner of the bitmap, but I didn't realize that meant that the coordinates for placing the image on the page also were based on the bottom left corner of the page...I thought they would be based on the Origin.

It's totally possible that the quotes are being put there by the reader. Just seemed weird that the quotes were there for Author and no other field. I have attached a screenshot for reference.

Thanks,
Bryan
Attachments
qassess_pdf.gif
qassess_pdf.gif (10.43 KiB) Viewed 81 times
Bryan Lewis
gdPicture 8.5.8 Ultimate
blewis
 
Posts: 20
Joined: Wed May 18, 2011 4:28 am

Re: GdPicturePDF DrawImage issue and SetAuthor

Postby EmanueleC » Mon Jan 23, 2012 12:16 pm

I upgraded gdpicture from 8.3 to last 8.5 and I get the same "Issue" with draw image, i solved as blews, changing y coordinate and using negative value fot that, but i guess if is it right (it's because i had the same pdf as with previuos version :) ), because in the example you never use negative value. I set origin to topleft and use centimetres.
EmanueleC
 
Posts: 11
Joined: Thu Dec 23, 2010 10:53 pm


Return to GdPicture PDF Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron