Setting OutputIntent for PDF/X

Hello. We are trying to create a PDF/X compliant document and need to specify a valid OutputIntent as required by PDF/X. We have been able to find and set other PDF/X specific attributed using something like…

Obj info = thisDoc.getTrailer().findObj("Info"); Obj conf = info.findObj("GTS_PDFXConformance");

…but we haven’t had any luck working with OutputIntent. Any guidance appreciated.

Thank you.

You could check for output intent along the following lines:

Obj root = doc.GetRoot();

Obj output_intent = root.FindObj(“OutputIntents”);

if (output_intent != null) {

Obj di = 0;

int i, sz = output_intent.Size();

for (i=0; i<sz; ++i) {

Obj intent = output_intent.GetAt(i);

if (intent.FindObj(“DestOutputProfileRef”)) { …


Obj dest_intent_stm = intent.FindObj(“DestOutputProfile”);

to add output intent something like (this one is for PDF/A but PDF/X is similar):

// Add RGB output intent…
Obj root = doc.GetRoot();
Obj output_intents = root.PutArray(“OutputIntents”);
dest_intent_stm = doc.CreateIndirectStream(byte_array);
dest_intent_stm.PutName(“Filter”, “FlateDecode”);
dest_intent_stm.PutNumber(“N”, 3);
Obj intent = output_intents.PushBackDict();
intent.Put(“DestOutputProfile”, dest_intent_stm);
intent.PutName(“Type”, “OutputIntent”);
intent.PutName(“S”, “GTS_PDFA1”);
intent.PutString(“OutputConditionIdentifier”, “sRGB IEC61966-2.1”);

For more on learning about low-level SDF API in PDFNet, please see SDF sample (included in SDK) as well as