Hi All,
I have two pdfs where comments/annotations are added by different users and need to imports documents 2 comments in documents1. This shows "Document Cannot Change" exception due to owner change.
Here is the sample code i tried.
PdfDocument authorPdf = PdfReader.Open(authorFile, PdfDocumentOpenMode.Modify); PdfDocument editorPdf = PdfReader.Open(editorFile, PdfDocumentOpenMode.Modify); foreach (DictionaryEntry entry in pdfTable) { PdfPage authorPdfPage = authorPdf.Pages[(int)entry.Key -1]; PdfPage editorPdfPage = editorPdf.Pages[(int)entry.Value-1]; foreach (PdfAnnotation pdfAnnot in editorPdfPage.Annotations) { // Console.WriteLine(pdfAnnot.Owner); //PdfAnnotation newAnnot = new PdfAnnotation(); //newAnnot = pdfAnnot; authorPdfPage.Annotations.Add(pdfAnnot); } } authorPdf.Save(authorFile);
Any solution/advice much appreciated.
Thanks Selvakumar
|