I’m using iTextSharp, in a C# app that reads PDF files and breaks out the pages as separate PDF documents. It works well, except in the case of portfolios. Now I’m trying to figure out how to read a PDF portfolio (or Collection, as they seem to be called in iText) that contains two embedded PDF documents. I want to simply open the portfolio, enumerate the embedded files and then save them as separate, simple PDF files.
There’s a good example of how to programmatically create a PDF portfolio, here:
Kubrick Collection Example
But I haven’t seen any examples that read portfolios. Any help would be much appreciated!
The example you referenced adds the embedded files as document-level attachments. So you can extract the files like this:
Pass the output file from the Kubrick Collection Example you referenced to the
PdfReaderconstructor (readerPath) if you want to test this.Hopefully I’ll have time to update the C# examples this month from version 5.2.0.0 (the iTextSharp version is about three weeks behind the Java version right now).