How to compare PDF files on Ubuntu
If you want to compare PDF files on Ubuntu, you can use one of the following tools.
Comparepdf
Comparepdf is a command line application that compares two PDF files. The default contrast mode is text mode, which compares the text of each page. Once the difference is detected, the program terminates and displays a message (unless-v0 is set) and an indicative return code.
Options for text mode comparison include-ct or -- compare = text (default) for visual comparison (this is useful when icons or other images change) options include-ca or -- compare = appearance. The-v = 1 or -- verbose = 1 option is used to report the difference (or do not respond to the matching file); The-v = 0 option is used to cancel the report, or-v = 2 to report different and matched files at the same time.
Install comparepdf to Ubuntu
Open the terminal and run the following command
sudo apt-get install comparepdf
Comparepdf syntax
comparepdf [OPTIONS] file1.pdf file2.pdf
Diffpdf
DiffPDF is a graphical application used to compare two PDF files. By default, it only compares the text on two related pages, but also supports comparison of graphical pages (for example, if the chart has been modified or the section has been reformatted ). It can also compare specific pages or page ranges. For example, if the same PDF file has two versions, one of which has page 1-12, and the other has page 1-13, because an additional page 4 is added here, they can be compared by specifying two page ranges. The first is 1-12, and the first is 1-3, 5-13, which can be used as the second page range. This allows DiffPDF to compare these pages (), (), and so on ).
Install diffpdf to ubuntu
Open the terminal and run the following command
sudo apt-get install diffpdf