问题
I am using iTextSharp to create on PDF document, later i want to add "Adding Enable for commenting Adobe Reader" using Acrobat, but i getting error as
You do not have permission to write to this file
Here my code used to create PDF file:
using (FileStream FS = new FileStream(dPDFFile_temp, FileMode.Create, FileAccess.Write, FileShare.None))
{
using (Document Doc = new Document())
{
using (PdfCopy writer = new PdfCopy(Doc, FS))
{
Doc.Open();
for (int i = 1; i <= R.NumberOfPages; i++)
{
writer.AddPage(writer.GetImportedPage(R, i));
}
Doc.Close();
}
}
}
回答1:
You are asking something that is impossible: see http://support.itextpdf.com/node/24
Making a PDF reader-enabled requires a private key that is owned by Adobe. Any third party other than Adobe using that key, would be in violation with the law.
来源:https://stackoverflow.com/questions/18894689/adding-enable-for-commenting-adobe-reader-using-acrobat