Detect printed portion of a page?

I am working with documents that are PDF files of CAD drawings. The drawings have a border around them, but the border is not always the same distance from the edge of the page. I need to know what this distance from the edge of the page to the border is. I guess that's called the margin.

Is there a way I can set a point in the document and tell whether there is something printed at that point? I'm thinking I can start at the edge of the page and move over, testing each point, until I find one that has some printing. When I get that, I'll have the edge of the border.

Make sense? How do I test a point?

Thanks

Steve

Hi Steve,

I’m afraid, I couldn’t understand your requirement. Can you please elaborate it with a sample PDF file etc?

We’re looking forward to help you out.
Regards,

I don't think a PDF file will help, so let me try to explain it again.

Consider a PDF made from a black and white text document. It will appear as black characters on a white background, or whitespace, the space that has no characters.

What I want to do is to examine a point on the page and be able to tell whether that point is whitespace/background or whether it is part of the black area that makes up one of the characters.

Does that make sense? Is that possible?

Steve

Hi Steve,

As I understand from your post, you’re interested to know the color displayed on a particular point i.e. (x,y) coordinates, in a PDF page. If so, I’m afraid this is currently not supported in Aspose.Pdf.Kit. Kindly confirm that I have understood your requirement properly, and I’ll forward a request to our development team to see if this feature can be implemented. We’ll update you accordingly.

We’re sorry for the inconvenience.
Regards,

Hi Shazad,

I think if I could detect the color of a point, it would work fine for what I want to do.

Thanks

Steve

Hi Steve,

Can you please try the following workaround to get the pixel color?

You can first convert the PDF page to image using PdfConverter and then get the color of the pixel using GetPixel method of the Bitmap class under System.Drawing namespace.

Does that help in your scenario? If you have any further questions or concerns, please do let us know.
Regards,

I am working with multi-page PDF files made from CAD drawings. Sometimes they are more than 20MB in size.

I am afraid that converting a document of that size to a bitmap and interrogating the bitmap is going to be somewhat unwieldy, but I will try.

It will take a couple days...

Steve