Setting OutputIntent for PDF/X

90 views
Skip to first unread message

Brian Hogue

unread,
May 28, 2014, 10:20:11 AM5/28/14
to pdfne...@googlegroups.com
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.






Support

unread,
May 28, 2014, 5:18:16 PM5/28/14
to

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 http://www.pdftron.com/pdfnet/intro.html
Reply all
Reply to author
Forward
0 new messages