Thank you.  That solved my issue.

That being said, is there any particular reason why the method to
write a Collection on PdfWriter is called setCollection while the same
method on PdfStamper is called makePackage?

It seems a little bit confusing.  Had the methods been named the same,
I probably would have figured this out while looking at the API
documentation.

On Thu, Nov 8, 2012 at 12:05 PM, iText Info <i...@1t3xt.info> wrote:
> Op 8/11/2012 17:14, Bernie schreef:
>> I am trying to create a pdf portfolio by embedding one or more pdf files into
>> a "portfolio" file.
>>
>> When creating this portfolio file from scratch, with PdfWriter and a
>> Document, the collection is set as expected.  However, if I try to set the
>> collection on an already existing pdf document, using PdfStamper, it does
>> not work.
>>
>> Is this expected behavior?
> If I only heard the question in words, I'd have answered no.
> When looking at your code, the answer is yes:
>> PdfWriter writer = stamper.getWriter();
>> PdfCollection coll = new PdfCollection(PdfCollection.HIDDEN);
>> coll.setInitialDocument("document1");
>> writer.setCollection(coll);
>
> The final line is wrong.
> You need the makePackage() method that is available in PdfStamper.
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_nov
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a 
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples: 
> http://itextpdf.com/themes/keywords.php

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to