logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Monday, March 4, 2019 9:48:06 PM(UTC)
 
Hi,

PdfViewer1.Document.Save(Enums.SaveFlags.NoIncremental)
This is saving in a custom way. When you call this method, the engine fires the PdfDocument.WriteBlock event and pass to the handler the data to being save. So you can save document in any way you want.

PdfViewer1.Document.Save(CurrentFile,Enums.SaveFlags.NoIncremental)
You cant to save the changes to the same file.
This is worth some explanation. Probably you noticed how even a very large PDF document with hundreds thousands of pages loads very fast. This becomes possible because there is not need to parse and load the entire document body. At first, only the cross-reference table is read and all the rest of data is loaded when needed. So the file is locked for write. You can't simultaneously read an object and write an another.
So you should implement an workaround. You can save to in memory byte array or to a temporary file, nex close original document and replace it with the saved copy.
oberon232 Posted: Monday, March 4, 2019 4:35:31 PM(UTC)
 
I worked around it, by reading the file in to a byte array and loading that as the document, that way there was no file lock on save.
oberon232 Posted: Monday, March 4, 2019 12:59:20 PM(UTC)
 
I have modified a PDF by adding a comment.
When I try to save using PdfViewer1.Document.Save(Enums.SaveFlags.NoIncremental), the comments don't save.
When I try to save using PdfViewer1.Document.Save(CurrentFile,Enums.SaveFlags.NoIncremental), an error returns that the file is in use.
When I try to save using PdfViewer1.Document.Save(NewFile,Enums.SaveFlags.NoIncremental), it saves to the new file.
My question, is there an option I need to set to either at save or load to be able to save changes to a PDF?