Hi,
I wish i could be more precise about this, but my memory is failing me here.
See, PDF format is complex yet the the structure is very simple, and you can build a parser for it in minutes, but the details for these objects are hard and very complex to parse and
handle, sound silly, yes it is, but i think the best approach for such cases which will give you deeper understanding for the PDF, by not reading the format specification itself but by using any already parser there, and here my memory failure, i used a software few years back and couldn't find it or even remember its name or location on my disks !!! shame
Anyway if you visit
https://en.wikipedia.org/wiki/List_of_PDF_software there is punch of software (none reminded me too), and there is one from that list
https://blog.didierstevens.com/programs/pdf-tools/ , here an example what parsing the objects should like with
GUI from that page
You can see the objects and paths ...., and their sizes !
There is in the Wikipedia page and punch of other software that can help you detect what have changed and in what size each.
Hope that isn't wasting you time but give some insight.
PS: i didn't used PDF parsing or handling in Delphi, except i added PDF Signature verification using SecureBlackBox with my own custom simplified PAdES as my license didn't cover that part, yet i can't find that project folder and the accessories tools with it on my drives, (may be i am losing it), anyway, i think there is an existing Delphi/Pascal libraries that will help you do what that parser/analyzer does, it is essential to add objects right, i mean getting list of the PDF objects, so if it is for me i would start with SynPDF and see what it offer in the matter of getting the PDF internal objects and their sizes.