How to save my changes to the existing PDF instead of "Save a copy".

Q:

How to save my changes to the existing PDF instead of “save as another”.

I checked the samples you provided and found no one to describe how to save the edits to current PDF file. Could you correct my code so that it can save edits into current file?

A:

If you call doc.Save(originalPdfFilePath, SDFDoc.SaveOptions.e_linearized) instead of doc.Save(newPdfFilePath, SDFDoc.SaveOptions.e_linearized) this will overwrite the original file. You can find more information in the documentation. Also instead of rewiting the entire file you can simply append chnages to the existing file (which can be very fast) with e_incremental instead of e_linearized:

doc.Save(originalPdfFilePath, SDFDoc.SaveOptions.e_incremental)