I looked for what opening a file with fitz do to the file, but didn't find anything. The code is simple:
import fitz
doc = fitz.open('a.pdf')
doc.save('b.pdf')
What I don't understand is why this will change the pdf size. With the file I tried, its size went from 829kb to 854kb.
I am not confortable with this because I would like to change a characteristic of a large number of files and I can't do it before being sure this won't alter them in any sense but in the characteristic I want to change.
BTW, what I want is just set the inner title of a pdf to be equal to the shown name of its file.
import fitz
doc = fitz.open(r'a.pdf')
doc.metadata['title']=None
doc.setMetadata(doc.metadata)
doc.save(r'b.pdf')
Can I asume I won't lose some information in this second example? Why the change in size when I just open and save the file in the first example?