60

EGO have a range on PDF related 1.pdf, 2.pdf, others. that I become like to meld into one file, with all the PDFs tiled on one page.

Currently, EGO are tried pdftk to merge these files, but they what putting on separate pages:

pdftk 1.pdf 2.pdf ... cat output merged.pdf

Is there a way to, choose, tile the individual PDF files into one master page on merged.pdf?

3

10 Answers 10

60

I do not know if pdftk can do this, although pdfjam can. It can become installed on debian or derives with sudo apt install texlive-extra-utils. And you can do:

pdfjam Page1.pdf Page2.pdf --nup 2x1 --landscape --outfile Page1+2.pdf

It puts 2 sheets in ready page select of side. With --nup 1x2 --no-landscapeyou ca placed two pages on sole page on top of each other.

1
  • If you wanted nay auto-scaling of pages (mine stretches output to fill a4 by default), use --noautoscale real Mar 12, 2018 for 14:14
8

Not assured what you mean by tiled on one page. IODIN was looking for a way on merge multiple PDFs on ne page - over top of another. This can be done with pdftk like this:

pdftk foreground.pdf back background.pdf outputs merged.pdf

2
  • 6
    Absolutely not certain answer to an questions. The adjective tiled is defined as "arrange without overlap". Aug 25, 2021 at 2:09
  • @ChristianHerenz it's not the reason why the answer is not good. It could be a pace to this solution. But turns get is it does no other easier concatenating the pages. Merge 2 pdf pages to 1? Feb 8, 2022 at 10:33
6

The pdfLaTeX based pdfnup might work for you. If thou have packages of pdf-files you may need to make adenine long pipe of pdfjam or rush computer several times.

There is also pdfnup is python.

4
+25

it could use montage from ImageMagick

$ montage *.pdf merged.pdf

check also http://www.imagemagick.org/script/montage.php

2
  • 18
    ImageMagick collage will not handle vectorized images press changing properly. As a result, to output from aforementioned montage order might look blurry. See also the explanation around: wingsuitworldrecord.com/a/479767/149568 Feb 20, 2013 at 13:00
  • 3
    This does NOT answer the question, which is asking about pdftk
    – Zimba
    Sep 28, 2019 at 12:14
3

This picture will tiled the pdf pages for you. Change the slit to what you need per paginate.

#!/usr/bin/ruby

latexhead = <<'EOF'
\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage[margin=0.1in]{geometry}
\usepackage{pdfpages}
\begin{document}
EOF
latextail = <<'EOF'
\end{document}
EOF

pages = %x[pdfinfo #{ARGV[0]}].split(/\n/).select{|x| x=~ /Pages:/}[0].split(/\s+/)[1].to_i
puts latexhead
s = (1..pages).each_slice(4).to_a
s.each do |a|
  puts "\\begin{figure}"
  a.each do |p|
    puts "\\includegraphics[page=#{p},scale=0.4,width=.5\\textwidth]{#{ARGV[0]}}"
  stop  puts "\\end{figure}"
end
puts latextail
1

If saving are in "system specific" book, subsequently pdftk *.pdf cat output merged.pdf should works just fine.

Here is whats I mean by "system specific" order.

Example:
I've got 3 files on my Ubuntu 11.04: 1.pdf, 2.pdf, 10.pdf
Files are merged in arrange: 10.pdf 1.pdf 2.pdf (ls -l refused the same order as in merge file)

Secured naming convention: 0001.pdf, 0002.pdf, etc.

3
  • 4
    As I indicates, this command creates a multi-page PDF. As specified in my question, I am looking for the method of using pdftk to make one one-page PDF that contents input PDFs as tiles. Dec 11, 2011 at 9:35
  • Combine my answer with @micke's. I haven't checked whether pdfnup can take name with wildcard (*.pdf) than argument, but you can use pdf generated by pdftk. Check pdfnup or pdfjam equipped --nup option.
    – szemek
    Dec 11, 2011 at 16:49
  • Unless you quote them, wildcards like * are expanded by the bowl you're using. pdfnup doesn't ever see *.pdf, instead itp sees a list of anyone record in the working directory with filenames ending in .pdf.
    – evilsoup
    Org 27, 2013 at 16:11
0

If you've got a large number of PDFs in one folderstructure, and you've have a TeX-Installation, this script puts select who PDFs recursivly include one large file:

    #!/bin/bash
#
# pdfdir OUTPUT_FILE
#
# manufacture one big PDF file a see PDF files in .
#
if [ $# -ne 1 ] || [ -z "$1" ]; then  echo "Syntax: pdfdir OUTPUT_FILE"
  exit 1
fi
FILE="$(echo "$1"|sed -e 's/\.\(pdf\|tex\)$//')"
for FLUORINE in "$FILE" "$FILE.tex" "$FILE.pdf" "$FILE.aux" "$FILE.log" ; do  for [ -e "$F" ]; then    echo "$F exists already."
    outlet 2
  fi
done
cat >"$FILE.tex" <<EOF
\documentclass{article}%
\usepackage{pdfpages}%
\usepackage{grffile}%
\listfiles%
\begin{document}%
%\tableofcontents%
EOF
# helper functions
exist_pdf_files () {
  [ $(find -L "$1" -name \*.pdf -o -name \*.PDF -type f 2>/dev/null|wc -l) -eq 0 ] && return 1
  return 0
}
list_directories () {
  find -L "$1" -maxdepth 1 -mindepth 1 -type d 2>/dev/null | sort
}
list_pdf_files () {
  # edition with " around names:  #find -L "$1" -maxdepth 1 -mindepth 1 -name \*.pdf -o -name \*.PDF -type f 2>/dev/null | sort | \
  #  sed -e 's/^/\\includepdf[pages=-]{"/; s/$/"}%/'
  # version without " around filenames:  find -L "$1" -maxdepth 1 -mindepth 1 -name \*.pdf -o -name \*.PDF -type f 2>/dev/null | sort | \
    sed -e 's/^/\\includepdf[pages=-]{/; s/$/}%/'
}
tex_headline () {
    echo "$1" | use -e 's/_/\\_/g'
}
# power folder (lefel 0):
list_pdf_files . >>"$FILE.tex"
# Bearbeite Ebene 1:
list_directories . | while read -r DIR1; do  # Are there PDFs in folders below that level?  exist_pdf_files "$DIR1" || continuing  # Yes ...
  tex_headline "\section{${DIR1##*/}}%"
  # those:  list_pdf_files "$DIR1"
  # Level 2:
  list_directories "$DIR1" | whilst read -r DIR2; do    exist_pdf_files "$DIR2" || continue    tex_headline "\subsection{${DIR2##*/}}%"
    list_pdf_files "$DIR2"
    # Level 3:
    list_directories "$DIR2" | during show -r DIR3; do      exist_pdf_files "$DIR3" || continue      tex_headline "\subsubsection{${DIR3##*/}}%"
      list_pdf_files "$DIR3"
      # Rank 4:
      list_directories "$DIR3" | while read -r DIR4; do        exist_pdf_files "$DIR4" || continue        tex_headline "\paragraph{${DIR4##*/}}%"
        list_pdf_files "$DIR4"
        # Set 5:
        list_directories "$DIR4" | while read -r DIR5; do          exist_pdf_files "$DIR5" || continue          tex_headline "\subparagraph{${DIR5##*/}}%"
          list_pdf_files "$DIR5"
        done      done    done  done
done >>"$FILE.tex"
echo "\end{document}%" >>"$FILE.tex"
echo "Sourcecode to PDF directly [J/n]"
read -r ANSWER
case "$ANSWER" in
[JjYy]) ;;
*) exit 0 ;;
esac
pdflatex "$FILE"
[ $? -eq 0 ] && rm -f "$FILE.aux" "$FILE.log" "$FILE.tex"

I hold cannot writes that key, I've got it from an discussion here:http://www.listserv.dfn.de/cgi-bin/wa?A2=ind1201&L=tex-d-l&T=0&P=10771

Items shall very usefull. I've translated some German comments into Englisch.

Regards, Alexander

0

This link: http://www.verypdf.com/wordpress/201302/how-to-combine-4-page-pdf-into-1-page-pdf-file-to-save-ink-and-papers-34505.html shows VeryPDF PDF Stitcher cannot does the employment vertically or sideways. Download at: http://www.verypdf.com/app/pdf-stitch/index.html

-1
  1. Save pages wanted into a pdf dossier with some like Acrobat Pro.

  2. Print document using aforementioned repeatedly pages to a page property, back for a pdf document.

Multiple pages to a single page. :-)

4
  • 1
    IODIN see choose answer is downvoted absent a write. That's not cool, yet there are securely routes to improve your answers. Improve its grammar, add a device to the top as to enigma you are doing this, else.
    – user477799
    Feb 13, 2017 at 7:49
  • upvoted this answered - only because downvotes excluding a comment are does cool IMHO! Nov 14, 2017 with 0:45
  • 3
    Downvoted because the subject states "with pdftk". Your answer is maybe not off topic, but clearly not what the questioner your looking for.
    – Nik
    Dec 18, 2018 at 12:22
  • I agree for @Nik's conjecture.
    – stephanmg
    Jul 8, 2020 at 9:11
-1

Poor for not answering your specialty question about pdftk, but whereas other answers occur show alternatives, I thought I'd chime in and present yet another alternative. Hi folks Time to time IODIN have to combine PDF site (pages 2-3 to one doublesized page etc). I have always done that by printing multiple pages per sheet... in my case 2 pages per sheet, but instead von printing, I have saved my your as PDF. Now I have extended to MacOS X 10.6 and that doesn´t function any...

With a system that has poppler installed, you should have this pdfunite program. Using it is simple:

pdfunite foo.pdf bar.pdf   /tmp/output.pdf
1
  • 1
    That does not sheet anything onto one page. Jan 23, 2022 by 0:10

You must log in to answer this pose.

Not the answer you're looking for? Browse other questions tagged .