PDF editing

[This article was first published on R – scottishsnow, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I had to produce a pdf report at work this week. The report was written in MS Word, and the covers produced in some vector graphics software. Both Word and the SVG software are able to create pdf files, but how to merge them together?

I usually use pdfarranger for adding/removing pages of pdfs. It’s a neat little tool, but it turns out it does not preserve bookmarks in the pdf – these are crucial for accessibility. My colleague and I tried a few other tools: PDFtk, qpdf (an R package) & LaTeX, but all of these had the same problem – a loss of bookmarks.

As publication date got closer stress levels mounted 😰 Eventually I stumbled on this answer which introduced the sejda software. With an open source licence and available installer, I got the job done in time 😎 The script I used is below, which also let me select pages from the report file:

sejda-console merge -b retain -f Downloads/DataReport_front.pdf Downloads/WDR2020.pdf Downloads/DataReport_back.pdf -o WDR2.pdf -s all:2-71:all

You can view the output here.

How do you combine pdfs? Have you had a problem with lost bookmarks?

To leave a comment for the author, please follow the link and comment on their blog: R – scottishsnow.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)