How do I set OPI information on PDF images? How do I create a low-resolution preview for the RIP job?

Q: We’re trying to use PDFNet (http://www.pdftron.com/pdfnet) to
implement the following functionality:

  • we have a rip that rips raster pdfs (as the four attached in this
    mail. These are 1200 dpi raster pdfs).
  • then we want to create a low-res pdf that has the following
    specifications:
  • the pdf will be a low-res preseparated pdf (so if I open the pdf
    with the preview output I can really see the actual separations of the
    pdf)
  • the separations internally must remain the number of the ripped
    page (for example, if the original pdf is CMYK + PANTONE, internally
    I’ll have 5 images that belong to the same page, but in the output
    preview I can disable one of the 5 channels separately.)
  • Internally the images (separations in low-res for example at 100
    dpi) must link the original hi-res pdf files through opi. The hi-res
    images will be in another folder on the server. So if I send the low-
    res pdf in the rip, it makes a substitution of the internal images
    with the hi-res rasterized ones.

A: To create a small (preview) PDF you can open each of PDF
separations and use PDFDraw to generate a page preview. Previews can
be added to a new PDF document and you can associate OPI information
with each image. A high-level pseudo-code would look as follows:

PDFDoc newdoc = new PDFDoc();
PDFDraw draw = new PDFDraw();
For each separation
{
PDFDoc doc = new PDFDoc(“separatio1.pdf”);
Bitmap bmp = draw.GetBitmap();

Page page = newdoc.PageCreate();
// Use ElementWriter & ElemetnBuilder to place a rendered image on a
new page in the newdoc
// Please see AddImage sample for more info on this step…
pdftron.PDF.Image img = pdftron.PDF.Image.Create(bmp);
Element img_elem = builder.Create(img, pos);
writer.WritePlacedElement(img_elem);
newdoc.PagePushBack(page);
doc.Dispose();

// Add OPI information…
Obj opi = img.GetSDFObj().PutDict(“OPI”);
Obj opi2 = opi.PutDict(“2.0”); // Use OPI 2.0
opi2.PutNumber(“Version”, 2);

// Set low-resolution proxy.
opi2.Put(“F”, pdftron.PDF.FileSpec.Create(doc, “sep1_low.tif”,
false).GetSDFObj());

// Set high-resolution image version.
opi2.PutString(“MainImage”, “sep1_high.tif”);


// For details regarding OPI dictionary values please see Section
14.11.7
// ‘Open Prepress Interface (OPI)’ in {DF Reference Manual (ISO
32000).
}
newdoc.Save(…)
newdoc.Dispose();

Q: with your method I haven't a single page with n separations inside,
but n pages with 1 black separation per page.
Also I am getting some errors from the RIP:

- the rip returns the error %%[ Error: undefined; OffendingCommand:
Overprint ]%%

If I add "/Overprint true" (or false it's the same...), the error is %%
[ Error: typecheck; OffendingCommand: Do(PDF); Info: ImageMatrix ]%%

I have to create a pdf exactly like the one attached (without 150 at
the end).
The difference are:
- The streams inside must be at low res (I have the CCITT image)
instead of these that are hi-res
- every image must have opi comments
----------
A: In case you want to merge all PDF separations into a single
composite image you would create only a single output page and would
add all images to this page (instead of adding them to separate
pages). You will also need to set fill/stroke overprint in the
graphics state to 'true'. For example: element.GetGState
().SetFillOverprint(true)

To add OPI information as shown in your reference PDF document you
could use the following snippet:

Image img = ...

// Add OPI information...
Obj opi = img.GetSDFObj().PutDict("OPI");
opi.PutRect("CropRect", 0, 0, 1118, 878);
opi.PutRect("CropFixed", 0, 0, 1118, 878);
opi.Put("F", pdftron.PDF.FileSpec.Create(doc, "/Hi-Res/001-blay-
foldex.C", false).GetSDFObj());
opi.PutBool("Overprint", true); opi.PutNumber("Version", 2);
opi.PutName("Type", "OPI");
Obj sz = opi.PutArray("Size");
  sz.PushBackNumber(19937);
  sz.PushBackNumber(14646);