Can't seem to find a straight forward answer for this. I'm using iText to open
an existing form, that has a owner password and then populate it, and save out
the results. Everything works if I Don't have a owner password.
So the Question is how to I define the owerPassword when opening the pdf?
Attached is a bit of my code. The error happens on the "reader =
createObject...." line.
pdfFile=expandPath("#inputPDF#"); //define the name of my output file
newFile=expandPath("#DestFile#"); //create the output file
ownerPassword = "xxx888";
fileIO=createObject("java","java.io.FileOutputStream").init(newFile); //load
the template PDF with the iText PDF reader
writeoutput("<BR>Processing fileIO");
reader =
createObject("java","com.lowagie.text.pdf.PdfReader").init(pdfFile); // <------
This is Where the code dies without a password, as the pdfFile has one defined
writeoutput("<BR>Processing reader");
pdfStamper =
createObject("java","com.lowagie.text.pdf.PdfStamper").init(reader,
fileIO); //create a form object to reference
writeoutput("<BR>Processing pdfStamper");
pdfForm = pdfStamper.getAcroFields();
.....etc etc...
Racine - 18 Sep 2007 03:21 GMT
i guess i answered my own question, by dev server must be running a differetn version of iText, opens fine on my production box with no password specified. Odd but ok i guess.