Last post Dec 15, 2010 04:57 PM by coldl_fusion
Dec 14, 2010 06:51 PM|coldl_fusion|LINK
I have been using Itextsharp for prefilling the fillable pdfs in .aspx pages. But when I am trying to do the exact same thing with i-9 file (downloaded from dept of homeland security), its generating a blank (size 0) pdf which is corrupt and couldn't be opened.
I am just copying the code snippet (I have all the necessary Itestsharp references in my solution) which is generating a corrupt pdf file (size 0).
string pdfTemplate = @"c:\PDF\i-9.pdf";
string newFile = @"c:\PDF\completed_i-9.pdf";
PdfReader pdfReader = new PdfReader(pdfTemplate);
PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(
However, if I do the same thing with any other fillable pdfs e.g. w4 it works perfectly fine. Any idea guys, what is going wrong in here?
Dec 15, 2010 11:17 AM|coldl_fusion|LINK
Dec 15, 2010 04:57 PM|coldl_fusion|LINK
Never mind guys... I see what the problem was... posting it here, in case any lands up searching for the same issue. Even though this file i-9 gets opened without any password prompt (it actually has an open password which is empty, and thus opens it without
asking for it), it has an owner password associated with it, which probably is governed by homeland of security. Without this privilege, it is not possible to modify this file (you can check its security settings by pressing ctrl + d and checking the security
tab) . You will see it has its content copy disabled for open user.
Since it is a password secured file and the intention was not letting anyone to be able to modify it, I am not going to try to modify it.