Sobesednik / node-exiftool

A Node.js interface to exiftool command-line application.
MIT License
91 stars 15 forks source link

Reading PDF Dictionary #57

Open mhirsch opened 3 years ago

mhirsch commented 3 years ago

I'm curious if there's a way to extract PDF Dictionary information with readMetadata() in this library. On the command line you can see this information printed with something like exiftool -v some.pdf but it seems like -v overrides -json, which this library is using to get JSON formatted output. At any rate when running exiftool with both -v and -json it seems to ignore -json and node-exiftool fails to parse the output with UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token E in JSON at position 0.

Looking into exiftool, it seems the PDF module only prints the dictionary info in Verbose mode: https://github.com/exiftool/exiftool/blob/ceff3cbc4564e93518f3d2a2e00d8ae203ff54af/lib/Image/ExifTool/PDF.pm#L1815