How do I get just the layout changes I made?


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?


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.
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