PDF Documents Manipulation Software options

Norman Gray norman.gray at glasgow.ac.uk
Wed Apr 22 22:36:02 UTC 2020


On 22 Apr 2020, at 23:14, Jordan wrote:

> Any suggestions that you use or have heard that works with FreeBSD?

I have gathered a few links here, with (it sounds) similar goals in 
mind, but each time round this loop I've managed to solve my immediate 
problems without investigating what I've found too rigorously.  Also, 
when doing this I've been primarily working on macOS.  Bearing all that 
in mind, however, my notes are below.

_Just_ before sending this message, Polytropon's message appeared 
on-list.  They queried your statement that

> I work
> with hundreds of PDFs each day so I cannot work within a CLI to
> manipulate the pages.

I think that, in drafting my answer, I'd automatically misread what you 
said as 'so I cannot work _without_ a CLI to manipulate the images'.   
Echoing Polytropon, what tools are useful of course depends on just what 
you need to do, but whilst acknowledging that I may be answering a 
question you didn't ask, my notes below focus on programmatic 
manipulation of PDFs.

Good luck,


There is a Python library called 
[pikepdf](https://github.com/pikepdf/pikepdf).  It looks promising, but 
I had a little trouble building it -- I gave up before trying very hard, 
though.  This tools compares itself (favourably, of course) to PyPDF2, 
which seems to be the conventional suggestion.

However it seems to install happily enough as a python package (via 
venv/pip).  Then:

     from pikepdf import Pdf
     import glob
     pdf = Pdf.new()
     for file in glob.glob('part?.pdf'):
       src = Pdf.open(file)


[pdftk](https://www.pdflabs.com/tools/pdftk-server/) is a ‘toolkit’ 
(not sure just what this means in this context), but it includes a 
interface](https://www.pdflabs.com/docs/pdftk-cli-examples/) which 
includes some useful examples such as

     % pdftk a.pdf b.pdf cat output ab.pdf

This also looks a bit tricky to build from scratch.

Norman Gray  :  http://www.astro.gla.ac.uk/users/norman/it/
Research IT Coordinator  :  School of Physics and Astronomy
// My current template week for IT tasks is: Monday, Tuesday, and Friday

More information about the freebsd-questions mailing list