Lars Eirik Rønning wrote:
> Each xobject in my pdf is placed on its own layer.

I was going to say: that's where you're wrong.
But you aren't. It's a matter of interpretation.

Let's have a look at this snippet:

/OC /MC0 BDC
q
0 841.89 595.276 -841.89 re
W n
q
1 0 0 -1 283.7324219 393.2568359 cm
/Fm0 Do
Q
EMC

/Fm0 refers to an external object (XObject) and it's indeed put
inside a BDC/EMC sequence that is marked as Optional Content.
The "re" and "W n" define a clipping path in the form of a rectangle.
In other words: the XObject is clipped. So the XObject is indeed
placed inside a layer, but I wouldn't say it's "its own" layer.

When I read each XObject is placed in "its own" layer, I interpret
this differently. I interpret this as: the complete XObject belongs
to a specific OCG or OC membership as described on page 374 of the
PDF Reference Manual:

I quote: "In addition to marked content within content streams,
form XObjects and image XObjects (see Section 4.7, "External Objects")
and annotations (see Section 8.4, "Annotations") may contain an OC
entry, which is an optional content group or an optional content
membership dictionary."

> The strange thing is that i am not (allthough i have read about this 
> before) able to find a reference to the oc in either of the objects streams.

In your PDF, the XObjects are unaware of the Optional Content Groups.
If somebody has given you the task to replace the XObjects inside
some OCG, you have to be very careful (I'd refuse the assignment
plain and square). Suppose you replace the XObject corresponding
with /Fm0 in the content stream above, what guarantee do you have
that this XObject isn't used on another place in your PDF OUTSIDE
an Optional Content Group? You risk corrupting your document by
replacing that XObject; unintentionally changing content that
shouldn't be changed.

> The pdfs are genreated from Adobe Illustrator.
> Any idea why the oc reference is left out?

I've answered this implicitly: if you don't define an /OC on the
XObject level, the XObject can be used in another context too,
regardless of Optional Content Groups.

> Btw i do mean to change the object stream, not the page content stream.

I assume you want to change the content of an XObject.
I hope the above explanation convinces you that the person
who gave you this assigmnent didn't think things through.
I'd return the assignment and send that person back to the
drawing board.
-- 
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to