My problem

I have two PDFs which I would like to merge to one PDF. The first one was generated with LaTeX and has links to the chapters, the second one is a GUI-draft with links created with Balsamiq.

How can I append the GUI draft to the LaTeX document with working links?

What I've tried

pdftk LatexDocument.pdf GUI.pdf cat output merged.pdf

worked, but links don't link to the correct pages any longer.

  • Did you ever figure out a good solution for this?
    – kylex
    May 18, 2013 at 1:20
  • @kylex: No. It seems to be impossible to merge two PDFs while keeping the link structure of both PDFs. I "solved" this problem by referencing to the other PDF as text ("See file 'GUI.pdf'") :-/ May 18, 2013 at 7:12

3 Answers 3


I found the answer to this question over at the TeX stackexchange: https://tex.stackexchange.com/a/8665

i.e. use ghostscript!

$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf source1.pdf source2.pdf source3.pdf etc.pdf

I found that unlike other utilities I tried, and the \includedpdf{} command mentioned here, the above gs command preserved my links when merging 4 pdfs, at least for my LuaLaTeX generated file.

Only one of my files contained links, but merging it in multiple times seem to preserve the right order.

Hope that helps!

  • I can confirm this preserves links. Aug 21, 2019 at 6:50

From within LaTeX you can include the other PDF, GUI.pdf, using pdfpages. Try something like this:

\usepackage{pdfpages}% http://ctan.org/pkg/pdfpages
% Other preamble content
% LaTeXDocument content

If the two documents have different page/stock sizes, pdfpages will rescale the included document to the source page sizes. To avoid this, use


and any additional options you may require. Read the pdfpages documentation for more information on the operations that can be performed on the input pages.

  • Well, the problem with that solution is that both PDF-files have different page sizes. I didn't figure out how to include a PDf with pdfpages without resizing. Dec 11, 2012 at 18:38
  • @moose: Did you read the documentation I linked to? Use the option noautoscale (page 4), since page sizes are automatically rescaled by default. I'll update my answer.
    – Werner
    Dec 11, 2012 at 18:44
  • Yes, I read the documentation. I tried this command \includepdf[pages=-,fitpaper=true,noautoscale]{../GUI/rendered/Entwurf.pdf}, but it did resize Entwurf.pdf (my GUI) to A4. I also tried it with fitpaper=true which also didn't work. Dec 11, 2012 at 18:51
  • @moose: It seems like your options fitpaper and noautoscale are contradictory. What about only noautoscale or with fitpaper=false?
    – Werner
    Dec 11, 2012 at 18:53
  • Only noautoscale didn't work. The image one the page didn't get scaled, but the page size of the document the GUI gets attaced to is wrong (A4). With only fitpaper=true the page size changed from A4 to the exotic one, but the image is ... well, not completely on the page. It's a bit to far at the top left. So I can't see the top/left part, but at the bottom/right is free space. And - by the way - the links get completely filtered. So even if it got correctly attached, I would need the links. Dec 11, 2012 at 19:02

You might like to try the recently launched Advanced PDF Manipulation tool : Sejda

It has different merging options available (it might work for you)


  • No, it doesn't work. Dec 9, 2012 at 18:03
  • @Moose: Thx for letting me know. If I find out further info I'll post it for you.
    – Simon
    Dec 9, 2012 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.