Project

General

Profile

Bug #4953

Blindly merging PDFs with ghostscript breaks pdfmarks

Added by Andre Prata almost 9 years ago. Updated over 8 years ago.

Status:
Fechado
Priority:
Normal
Assignee:
Start date:
10/25/2012
Due date:
% Done:

100%


Description

When joining PDFs with ghostscript (see Makefile thesis and publish), any pdfmark information within the matter will be incorrect, as the pages they refer will have to be skewed by the amount of pages from the cover part.

pdf-merge.py [1] is a script that uses pdftk to extract pdfmark information to later fix and merge with the final PDF, using ghostscript.

It works, but is not compatible with python 3 (at least not with 3.3.0). Python 2 works (at least with 2.7.3)...
It also allows setting PDF author, title and keywords information to the Header.

[1] http://blog.tremily.us/posts/PDF_bookmarks_with_Ghostscript/

Associated revisions

Revision e2fa9320 (diff)
Added by André Prata almost 9 years ago

Use pftk to concatenate cover and matter. Fixes #4953

Revision e2c5dde7 (diff)
Added by André Prata almost 9 years ago

Yet another solution for pdf merging. Fixes #4953 (again)

History

#1 Updated by Andre Prata almost 9 years ago

A tiny update...

Actually, pdf-merge.py fixes the PDF bookmarks, but not local references (ToC, Acronyms, ... basically hyperref)...

#2 Updated by Anonymous almost 9 years ago

  • Status changed from Novo to Resolvido
  • % Done changed from 0 to 100

#3 Updated by Andre Prata almost 9 years ago

Interestingly, the work from pdf-merge.py is unecessary, pdftk can handle concatenation, fixing bookmarks in the process...

#4 Updated by Andre Prata almost 9 years ago

  • Status changed from Resolvido to Em Curso
  • Assignee set to Andre Prata

Forget about the fix. This is very hard to solve as there are two "categories" of PDF links -- bookmarks and references (links to sections, figures, acronyms, etc).

What ghostscript does:
Merges the documents losing roman numberings, breaking bookmarks, as well as references.

What pdftk does:
Merges the documents losing bookmarks, but the references are flawless.

What pdf-merge.py does:
Merges the documents keeping bookmarks, but the references are broken.

What me does:
Added \usepackage{pdfpages} to the preamble of matter.tex and the \includepdf{cover.pdf} command right after \begin{document}.
So:

\documentclass%...
%...

\usepackage{pdfpages}
%...

\begin{document}
\includepdf{cover.pdf}
%...

\end{document}

Works like a charm!

#5 Updated by Anonymous almost 9 years ago

  • Status changed from Em Curso to Resolvido

#6 Updated by João Paulo Barraca over 8 years ago

  • Status changed from Resolvido to Fechado

Confirmado.

Also available in: Atom PDF