# Editing pdf files with Mathematica

As an example, consider this pdf file.

Would it be possible to edit the pdf, such as removing a logo, the page numbering and even frames, and save the result as a pdf? I would like to keep the pdf vectorial data and actually remove the content, not just hide with a white rectangle.

The reason I am asking is that I have a lot of pdf files that I would like to "clean" in a batch MMA script. The solution can call external software (my OS is Ubuntu).

• It is easy to add a blank rectangle in front of the logo (easy), which leaves the data itself in the pdf file, just not visible when printing or looking on a screen. Presumably you want more. For that you'll need to be more precise as to whether all pdf files you have have exactly the same structure, and you'd have to look into the pdf file itself (with a text editor) to see if they are binary or plain text (depends on the compression level) etc. – Bruno Le Floch Nov 4 '17 at 22:47
• At tex.stackexchange.com/questions/38145/… I see the suggestion that qpdf --qdf --object-streams=disable test.pdf test-long.pdf makes a pdf that is easier to work with (not compressed). Perhaps you can then find the part to remove (some knowledge of the pdf format is needed). – Bruno Le Floch Nov 4 '17 at 22:54
• @BrunoLeFloch To fill my needs, I have to 1) be able to read the uncompressed pdfs in MMA, 2) understand the structure of the pdfs to edit them. I agree that it cannot really be answered... I tried the qpdf command, as well as pdftk to uncompress, unfortunately I have some invalid characters. I need to sort that out first... – anderstood Nov 6 '17 at 18:44