PDFNet renders some colors differently from Acrobat. How do I adjust color conversion?

72 views
Skip to first unread message

Support

unread,
Mar 15, 2007, 3:37:22 PM3/15/07
to PDFTron PDFNet SDK
Q:

I have a PDF that contains a pie chart that is shaded with a dark
bluish/purplish color. When I view the PDF with the PDFView component
the shaded area of the pie chart shows up as a normal blue instead of
the original color as when opened with Adobe Reader. How do I adjust
color conversion?

---

A:
The color difference is most likely due to different settings that
drive color conversion in Acrobat and PDFNet. Using PDFNet SDK, you
can adjust color conversion by overriding default RGB and CMYK color
profiles (using PDFNet.SetColorManagemen(true) and
PDFNet.SetDefaultRBG/CMYK-ColorProfiles()).

You can download standard Adobe ICC profiles using the following link:
http://www.adobe.com/support/downloads/detail.jsp?ftpID=3145 (or
Google search "Adobe ICC").

Any other profiles will also work, but the above ones are good in case
you would like to get closer to Acrobat color output. After
downloading the archive, copy all *.icc files to PDFNet resource
folder (i.e. path you use in PDFNet.SetResourcesPath(...), you can
also place ICC profiles to any other location, but in this case you
need to provide absolute paths).

Finally you can set the profiles after calling
PDFNet.SetResourcesPath() as follows:

try {
// Optional: Set ICC color profiles to fine tune color conversion
// for PDF 'device' color spaces. You can use your own ICC
profiles.
// Standard Adobe color profiles can be download from Adobes site:
// http://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html
//
// Simply drop all *.icc files in PDFNet resource folder or you
specify
// the full pathname.
PDFNet.SetColorManagement(true);
PDFNet.SetDefaultDeviceCMYKProfile("USWebCoatedSWOP.icc"); // will
search in PDFNet resource folder.
PDFNet.SetDefaultDeviceRGBProfile("AdobeRGB1998.icc");
}
catch (Exception) {
// Console.WriteLine("The specified color profile was not found.");
}

Reply all
Reply to author
Forward
0 new messages