Help with pdf manipulation

5 réponses [Dernière contribution]
filologen
Hors ligne
A rejoint: 04/07/2010

Yesterday I switched to Trisquel from Ubuntu and found out that pdftk is not available in Trisquel because it depends on some propriatory stuff even though pdftk itself is free software.

I used to use pdftk to merge two pdf files, the first of which consisted of a scanned file with correct page order (1, 3, 5, 7 ...) while the second consisted of a scanned pdf file with wrong (opposite) page order (... 8, 6, 4, 2). These file were the result of scanning a copy with duplicate pages in two steps (first the uneven, then the even pages) on a scanner/copying machine.

To merge the two files correctly I did the following:

# Split file with correct page order into single pdf files:
pdftk $1 burst output page_%04da.pdf

# Make the file with wrong (opposite) page order have the correct page order:
pdftk $2 cat end-1 output fil3.pdf

# Split the resulting file into single pdf files:
pdftk fil3.pdf burst output page_%04db.pdf

# Join all the files into one pdf file based on the file names
pdftk page_*.pdf cat output output.pdf

Any idea of how this can be done with the tools provided in Trisquel?

Best regards
Filologen

flop

I am a translator!

Hors ligne
A rejoint: 02/16/2009

I think there are several programs which may do what you want: try "pdfedit", "pdfshuffler", "pdfsam" or "pdfjam". They all have a graphical interface, I believe. Google about their web pages and see which one would better serve you.

Regards.

filologen
Hors ligne
A rejoint: 04/07/2010

Thanks for your reply, but I want to avoid a graphical interface.

flop

I am a translator!

Hors ligne
A rejoint: 02/16/2009

Perhaps you may use some of them through the terminal? Have you checked what synaptic has to offer?

Regards.

akirashinigami

I am a member!

I am a translator!

Hors ligne
A rejoint: 02/25/2010

I'm not familiar with pdftk, but you might be able to download the source code from the pdftk website, and compile it.

filologen
Hors ligne
A rejoint: 04/07/2010

Thanks for all your suggestions:)

The problem with pdftk lies in the licensing of the internal itext library, and this seems to have been solved in the latest debian (sid) where pdftk has been patched to use the external itext library (which has no license issues).

I therefore installed the latest relevant debian sid packages by downloading them from the debian repository (pdftk_1.41+dfsg-7_amd64.deb, libitext-java_2.1.7-1_all.deb, libitext-java-gcj_2.1.7-1_amd64.deb, and libitext-rups-java_2.1.7-1_all.deb).

This works fine, and I should now have a free pdftk and do not need to change my script.

Best regards
Filologen