Matthew Atherton wrote:
>
> 1T3XT BVBA wrote:
>> You should use PdfStamper instead of Document/PdfWriter!
> I would love to do that, especially since PdfStamper seems to be the only
> class that can flatten the annotations,

iText can't flatten annotations. iText can only flatten forms (=> widget 
annotations).

>   unless I am missing something (which is likely).
Your mails are very confusing. Hence it is very hard to assist you.
> However, I need to be able to save the file as PDF_VERSION_1_4.

You probably don't. The version number is probably irrelevant. Maybe you 
just need to decompress the XRef table and some objects. But that's only 
a guess: I can only repeat that your mails are very confusing.

> If I can use the writer from the PdfStamper to do this, then I think I
> should be able to switch....  But I need to know the correct process for
> flattening the annotations.  I can only find articles on flattening form
> fields...

What annotations are you talking about? Let me give you an example that 
hopefully explains why what you're asking doesn't make sense. Suppose 
you have a Link annotation. That's an INVISIBLE (!) rectangle. When you 
click inside the area defined by this rectangle, a page defined by an 
URI opens in a browser. How would you flatten such an annotation? What 
do you expect to happen? Do you want to see some VISIBLE trace of the 
Link annotation? If not, aren't you asking to remove the annotation 
instead of flattening it?

  Changing the version number is a no-brainer:

PdfReader reader = new PdfReader("test.pdf");
PdfStamper stamper = new PdfStamper(reader, new 
FileOutputStream("test1.pdf"), '4', false);
stamper.close();

The '4' in the constructor of PdfStamper, will change the version number 
in the PDF. This is what you "want", but it may not be what you "need". 
If it's not what you "need", please rephrase what you "want".

I understand that you're not a PDF or iText specialist, but we at 1T3XT 
have to MAKE A LIVING as PDF / iText specialists. People like your boss 
who use software that "only works for PDF 1.4" and who hire people who 
"are newbies in PDF" that try to get a PDF specialist "to work for free" 
are bad for business. Can you put yourself in our place? Do you 
understand our point of view?

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
iText-questions mailing list
[email protected]
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