It doesn't sound that way, no.
I wonder if this is a technical issue, or a common sense one... lets have a
look... There's nothing in the PDF spec about it, and I don't see anything in
the code either.
How can you tell that append mode was disabled? Is it just that your PDF is no
longer Reader Enabled or did you actually look at the file internals? I
suspect the latter. That leads me to believe that the Reader Enabling doesn't
work with new embedded files.
Can we see your PDF?
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
________________________________
From: Michael Marcavage [mailto:mmarcav...@andersontechs.com]
Sent: Monday, March 14, 2011 2:46 PM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] Append Mode and Attachments
The below code works well to take attachments and add them to a PDF
Fillable Form
however it overrides the append mode feature, taking away the PDF to be
edited in Adobe Reader, after it is created
Is there a way to add attachments to a PDF Fillable Form and keep the
feature of allowing Adobe Reader to edit the PDF Fillable Form
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest),
'\0', true);
AcroFields form = stamper.getAcroFields();
form.setField("txcCompanyName", strPassFieldValues[0]);
form.setField("txcAddress1", strPassFieldValues[1]);
form.setField("txcCity", strPassFieldValues[2]);
form.setField("txcState", strPassFieldValues[3]);
//APPEND ATTACHMENTS -->
System.gc();
byte buf[];
int len;
Vector v = passDoc.getEmbeddedObjects();
if(v.isEmpty())
{
String appfilename;
EmbeddedObject appfile = null;
v =
s.evaluate("@AttachmentNames", passDoc);
for(int i = 0; i < v.size();
i++)
{
appfilename = (String)
v.elementAt(i);
if(!appfilename.equals(""))
{
appfile =
passDoc.getAttachment(appfilename);
InputStream
tmpis = appfile.getInputStream();
InputStream
tmpin = new BufferedInputStream(tmpis);
ByteArrayOutputStream tmpbos = new ByteArrayOutputStream();
buf = new
byte[1024];
while((len =
tmpin.read(buf)) > 0)
{
tmpbos.write(buf, 0, len);
}
tmpis.close();
tmpin.close();
appfile.recycle();
stamper.addFileAttachment("File Attachments", tmpbos.toByteArray(),
appfilename, appfilename);
System.out.println("Attachment Added");
tmpbos.flush();
System.gc();
}
System.gc();
}
}
v = null;
System.gc();
//<-- APPEND ATTACHMENTS
stamper.close();
Tschüss,
Michael Marcavage
VP of Software Development
Anderson Technical Services
856 912-7696
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
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