PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 11, 2024 4:25 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Jul 06, 2011 2:00 pm 
Offline

Joined: Wed Jul 06, 2011 1:44 pm
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 07, 2011 3:14 pm 
Offline

Joined: Wed Jul 06, 2011 1:44 pm
Posts: 2
Any advise or direction is helpful for me to decide further?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 39 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group