Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 99919

What are the requirements for successful use of PDSElementInsertMCAsKid()?

$
0
0

I've been struggling all day. On Friday I had working code that merged content from multiple PDF pages into a single page in a new PDF. Optional content and object data were preserved. However, I needed to create my own optional content around each page ingested and remove any existing option content from the source pages. Some refactoring was performed and now I have code that does everything I need to do, except that PDSElementInsertMCAsKid() errors with a message about finding an incorrect structure in the PDF file. If I comment out this call I get a PDF with a correct structure tree except for not being connected to the content stream. So how could I have botched it up?

 

Before I was replicating everything in the source content stream into the destination content stream. Now I'm creating an optional content container and content for each ingested PDF page. After creating the container I traverse the source content stream. When an optional content container is encountered the container is ignored and the contained elements are added directly to the destination content stream. If one of those contained elements is an object data container a new container and new content is created. A PDSElement is created and initialized from the source PDSElement, and added to the destination structure tree. I don't think there has been any changes to the object data code, only to the how I'm handling optional content.

 

I'd appreciate any ideas or information on how PDSElementInsertMCAsKid() works that anyone has.

 

TIA,

Alan


Viewing all articles
Browse latest Browse all 99919

Latest Images

Trending Articles



Latest Images

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