|
|
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.
|
|
|
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.
|
|
|
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?
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close