<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>The Wombelix Post - Bash</title><link href="https://dominik.wombacher.cc/" rel="alternate"/><link href="/feeds/tag_bash.atom.xml" rel="self"/><id>https://dominik.wombacher.cc/</id><updated>2019-10-28T15:38:00+01:00</updated><entry><title>Merge PDF Files on Linux</title><link href="https://dominik.wombacher.cc/posts/merge-pdf-files-on-linux.html" rel="alternate"/><published>2019-10-28T15:38:00+01:00</published><updated>2019-10-28T15:38:00+01:00</updated><author><name>Dominik Wombacher</name></author><id>tag:dominik.wombacher.cc,2019-10-28:/posts/merge-pdf-files-on-linux.html</id><summary type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;I had to use Cups-PDF and "Print" bunch of Pages to Single PDF Files due to the fact that no Download as PDF was possible.
But how to Merge tons  ... &lt;a class="read-more" href="/posts/merge-pdf-files-on-linux.html"&gt; [read more]&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;I had to use Cups-PDF and &amp;quot;Print&amp;quot; bunch of Pages to Single PDF Files due to the fact that no Download as PDF was possible.
But how to Merge tons of files named as &lt;strong&gt;Pagetitle-job_id&amp;lt;Number&amp;gt;&lt;/strong&gt; on Linux via command line in a fast and easy way?&lt;/p&gt;
&lt;p&gt;After some testing, &lt;code&gt;pdfunite&lt;/code&gt; - included in &lt;em&gt;Poppler&lt;/em&gt; and already installed on openSUSE Tumbleweed - did the job,
but the result with &lt;code&gt;pdftk&lt;/code&gt; - included in &lt;em&gt;Ghostscript&lt;/em&gt; - was nearly identical and worked the same way.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
pdfunite $(ls -cr *.pdf) output.pdf

&lt;/pre&gt;
&lt;p&gt;With &lt;code&gt;$()&lt;/code&gt;, &lt;code&gt;ls&lt;/code&gt; will executed and the results are added to the &lt;code&gt;pdfunite&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;All PDF Files in the same Folder will be merged to a single &lt;strong&gt;output.pdf&lt;/strong&gt; File.&lt;/p&gt;
&lt;p&gt;The Parameter &lt;code&gt;-cr&lt;/code&gt; sorts by creation time in reverse order.&lt;/p&gt;
&lt;p&gt;That was necessary for me because the Job IDs were from 36 till 223, all other parameter mixed up the order and the merged PDF wasn't as expected.&lt;/p&gt;
</content><category term="Linux"/><category term="Bash"/><category term="CUPS"/><category term="PDF"/><category term="openSUSE"/></entry></feed>