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.
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.
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.
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,