We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Determine the color of a coordinate in a PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

142912 Feb 25,2019 07:50 PM UTC Feb 26,2019 05:02 AM UTC ASP.NET Web Forms 1
loading
Tags: PDF
Brian Futrell
Asked On February 25, 2019 07:50 PM UTC

I'm using the Syncfusion File Formats library in a console application referencing .NET Framework 4.7.2 to create PDFs based on values passed to the program.

So far everything works properly, but was wondering if given a location on the page (x,y) is there a way to return what color is at that location.  I'm wanting to draw a line up to the point a color matching a color used in an image is found.

KarthikeyanC [Syncfusion]
Replied On February 26, 2019 05:02 AM UTC

Hi Brian, 
Greetings from Syncfusion. 
Yes you can achieve this requirement by following the below steps. 
  1. Convert PDF to Image using the below code snippet.
// Load PDF document 
PdfLoadedDocument ldDoc = new PdfLoadedDocument("input.pdf"); 
// Convert first page to image 
Bitmap page0 = ldDoc.ExportAsImage(0); 
  1. Get the color from the image using the GetPixel method.
Regards 
Karthikeyan   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;