There are a lot of questions and answers regarding the best PDF viewer available with Ubuntu. But I want to parse the PDF file and know details of PDF, such as images, fonts and links that are available in a given PDF file.

Are there any PDF metadata viewers available?

share|improve this question
    
Close voters: Just because this question says "best" in the title does not make it opinion-based! – Seth Aug 31 '14 at 22:40
up vote 30 down vote accepted
  1. View pdf metadata for a file called Example.pdf:

    pdfinfo Example.pdf  
    
  2. Edit existing metadata in the terminal using nano editor:

    pdftk Example.pdf dump_data output Metadata-output.txt
    nano Metadata-output.txt  
    
  3. Update metadata:

    pdftk Example.pdf update_info Metadata-output.txt output Example-new.pdf
    

Nano editor keyboard shortcuts
Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location.
Use the keyboard combination Ctrl + X to exit nano.

share|improve this answer

CLI solution

Another utility worth looking into is exiftool. The advantage exiftool holds over pdfinfo is that it supports a lot more metadata types (e.g. XMP tags).

Here's an example of a command that will print all available meta information (-a), sorted by groups (-G1):

exiftool -a -G1 "$File"

Overviews of the supported PDF-related tags:

You can install exiftool on Ubuntu with:

sudo apt-get install libimage-exiftool-perl

GUI solution

If you are looking for a GUI PDF metadata viewer/editor you could give PDFMtEd a try. It's a a set of graphical utilities I wrote for managing PDF metadata with exiftool:

enter image description here

enter image description here

share|improve this answer

The answer of "best" really depends on how much detail you want and on how stable you want the viewer to be. There exists many softwares for viewing and even editing post script and pdf files in linux; all which seem to have been removed from the current Ubuntu repositories (probably due to stability issues).

For now I'd recommend trying pdfedit. If you are using Quantal or earlier it can be installed via

sudo apt-get install pdfedit

For newer releases you'll need to download it from it's project page, unpack it, and compile it your self.

share|improve this answer
    
I dont want a viewer. I need a parser which can fetch details from pdf file like links available in file ....images available ...index of file etc. – Sahil Grover Jan 7 '14 at 5:04
    
Sorry, got pdftk confused with pdfedit because they removed pdfedit from the repositories – virtualxtc Jan 7 '14 at 5:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.