At work, editors create books in XML which is then imported into Indesign and then archived as PDFs of the final print copy. Additional edits are made directly to InDesign and final PDF during proofs and layouts which means the XML goes out of sync with the final contents.
How would you go about comparing the contents of the XML and its corresponding final InDesign or PDF file so that any changes made can be identified and the XML brought up to date? The approach I'm trying to take is to
- Extract the text from PDF \ InDesign
- Transform the XML with script
- Use a diff tool to spot the differences between the two
Steps 2 and 3 seem sound but pulling text out from the PDF is tricky due to multi-column layouts and heavy design making "Save as Text" not an option.
Is there a better way to do this that anyone knows of? Would working with the InDesign file rather than the PDF be easier? Is there a clever tool that would make everything simpler?
pdftk
andcompare
(from ImageMagick) can do this, and would allow the process to be scripted on Linux and probably others... would that be helpful?