Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Why would a newly-created OCMD not be written to the PDF?

$
0
0

I'm concatenating a content stream from a second PDF onto the page content stream of a first PDF. Graphics and structure are working fine, but optional content is failing because the OCMDs I'm creating are being written as free objects.


The function is passed an element from the second PDF's content stream. If the element is a container, the following is executed. I'm leaving out steps related to structure, because it works. Graphics also work. Even newly-created OCGs make it into the output PDF. I'm guessing the OCMD isn't written because there is no reference to it? But  I though the PDEContainerCreate() call would create that reference.


1. Create an OCG with PDOCGCreate().

2. Create an OCMD with PDOCMDCreate(). The OCG is set to control the OCMD.

3. Create new container with PDEContainerCreate(), passing the new OCMD.

4. Check the CosID of the OCMD.

5. Create new content with PDEContentCreate().

6. Assign the new content to the new container with PDEContainerSetContent().

7. Add the container to the first PDF's content stream with PDEContentAddElement().

8. Add all the sub-elements of the element from the second PDF to the new container.


Viewing all articles
Browse latest Browse all 10848


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>