Here is some background:
writing an app that creates pdfs from data in a database, merges it with uploaded files from same database. All is fine until a pdf that is encrypted/password protected is encountered. the Append method of the MergeDocument instance throws the exception:
11/19/2009 3:36:43 PM
Document can not be decrypted. Invalid owner password.
ceTe.DynamicPDF.35
at ceTe.DynamicPDF.Merger.PdfDocument.g()
at ceTe.DynamicPDF.Merger.PdfDocument..ctor(c0 A_0, String A_1)
at ceTe.DynamicPDF.Merger.PdfDocument..ctor(String filePath)
at ceTe.DynamicPDF.Merger.MergeDocument.Append(String filePath)
at refrecToPDF.Form1.convert(DataTable dt) in D:\stuff\refrecToPDF\refrecToPDF\Form1.cs:line 271
at refrecToPDF.Form1.but_go_Click(Object sender, EventArgs e) in D:\stuff\refrecToPDF\refrecToPDF\Form1.cs:line 56
the code is as follows:
MergeDocument test = new MergeDocument();
test.PdfVersion = PdfVersion.v1_7;
foreach (string zz in fileList)
{
test.Append(zz);
}
if (test.Pages.Count > 0)
{
finalPDF = test.Draw();
}
I have used other pdf merging utilities and they merged just fine but did not support pdf spec 1.5+. This is a must have for me since the files Im merging are letters of recommendation to a number of graduate programs at a university, which is why we get so many pdfs that are password protected.
Any help would be greatly appreciated.
Thanks,
jimm