new method name "write_metadata"
you can pass a folder name or a pdf name