DrawRecangle

Discussions about PDF management.
Post Reply
win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

DrawRecangle

Post by win568 » Fri Sep 11, 2015 12:00 pm

Hi

I Tried to draw Rectangles on a PDF. Unfortunatelly the Coordinates are in Pixel and the SetMeasurementUnit does not have the Possibility for Pixel. What must i do to draw Rectangles with Pixel Coordinates ??

delbeke
Posts: 89
Joined: Wed Oct 31, 2012 5:07 pm

Re: DrawRecangle

Post by delbeke » Fri Sep 11, 2015 3:23 pm

Hi Win568

It makes no sense to use pixels units to draw on a PDF.
The Pdf is a vector based format and there is no information in the pdf (usualy called dots per inches or DPI) to translate pixels to device independant units such as points,inches, millimeters and centimeters.
What you can do is to rasterizer the pdf in an image (it needs an information on dots per inches to be done), draw your rectangle in this image and then create a new pdf using this image as the page's content.

Jean-Luc

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DrawRecangle

Post by Loïc » Sat Sep 12, 2015 11:44 am

Hi,

I suggest to use points. In a PDF 1 inch = 72 points.

Kind regards,

Loïc

win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

Re: DrawRecangle

Post by win568 » Mon Sep 14, 2015 9:40 am

Hi

Thank you for your quick answers. The problemn i have is, that we make an OCRScan of a PDF Document. After this, we build out of the Characters words (with their coordinates) and mark Special words in the PDF with a Rectangle. Unforunately the Coordinates are in Pixels. Is there a Possibility to use the Image of the PDF ??

win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

Re: DrawRecangle

Post by win568 » Mon Sep 14, 2015 10:37 am

Hi

OK, Found the Solution. Ask the PDF for its Resolution and Recalulate the OCR Results.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest