How do I get just the layout changes I made?

Question:

I am making changes to a PDF on one machine, and I want to apply them to the same PDF on another server, but I don’t want to transfer the entire file.

Is there a way to just get those changes?

Answer:

Yes, what you want to do is an e_incremental save, which only appends the bytes needed to apply the change, with out modifying the original file.

// store size of file on disk pdfdoc.Save("path_to_file_on_disk", e_incremental); // get new size of file on disk, and read the added bytes

Then you can transfer these bytes to the server, and then using the OS append the bytes.

Note, that you cannot use incremental save on files with a corrupt cross reference table, without first re-saving the repaired file.

This post shows how to detect this case. https://groups.google.com/d/msg/pdfnet-sdk/uPLT9156YYY/c3fU7Y0NAwAJ
If you encounter a repaired file, ideally you would trigger a save, using e_linearized (or e_remove_unused). Then you can do incremental from that point on.

This post explains the different save types
https://groups.google.com/d/msg/pdfnet-sdk/h_zoSC-2HOo/D1kFzcHhDQAJ