[gdal-dev] Anchor point in PDF EXTRA_IMAGES

Even Rouault even.rouault at mines-paris.org
Thu Nov 22 11:05:32 PST 2012


Le jeudi 22 novembre 2012 11:21:08, Jukka Rahkonen a écrit :
> Hi,
> 
> In the PDF creation option parameter EXTRA_IMAGES=image_file_name,x,y,scale
> the anchor point (x,y) is in the lower left corner of the resulting PDF
> file. However, the anchor point of the extra images to be added seems to
> be in the upper left corner. If someone tries to use this parameter as
> EXTRA_IMAGES=logo.png,1,1,1 the top left pixel of logo.png will be placed
> at the lower lext pixel of the PDF file. Thus the logo.png will never come
> into PDF because it is draws totally below the PDF print area.
> 
> Could it be possible to make EXTRA_IMAGES and the actual images to
> understand anchor points in a similar way? Either so that
> EXTRA_IMAGES=image_file_name,x,y,scale takes also the top left coordinates,
> or if it continues to use lower left anchor point then the PDF driver is
> placing the lower left pixel of the extra image to that place.
> 
> The curret behaviour is somewhat surprising. At minimum the document page
> should mention this somehow, for example as
> 
> "Notice, that x and y are in user units from the lower left corner of the
> page. Use some reasonably high value for y or otherwise the extra image
> will slide out of the PDF page".

well, that's true that there was a lack of consistency. I'm not sure which 
convention is best, so I've finally kept x,y as being expressed from the lower 
left corner of the page (that's consistant with the PDF logic : the origin of 
coordinates in PDF is the lower left corner of the page), but changed the 
anchor point to be the lower left pixel of the image.

You'll have to update your tutorial a bit, which is of great value by the way!

Even


More information about the gdal-dev mailing list