Color management in PDFDraw. Differences in image quality


I run into an issue whare the colors of the page using newer versions of the PDFNet library are lighter than the one produced with an older version (or Acrobat output). If rendering the content using the GDI+ rasterizer the content renders as expected (using PDFNet 5.6/5.7). I think this might be related to the background, (white versus transparent) but want to verify that this functionality has changed between the two versions. Here is the logic that we employ for image rasterization:

using (var draw = new PDFDraw()) {

var hint_set = new ObjSet();
var encoder_param = hint_set.CreateDict();
encoder_param.PutNumber(“Quality”, recommendations.RecommendedQuality);
draw.Export(page, file, recommendations.RecommendedFormat, encoder_param);

A: The difference is most likely due to color management.

To solve the problem turn on the color management with PDFNet::SetColorManagement() - just after PDFNet::Initialize().