<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux für alle &#187; pdf</title>
	<atom:link href="http://www.simplylinux.ch/tag/pdf/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simplylinux.ch</link>
	<description>Jeder kann Linux beherrschen lernen...</description>
	<lastBuildDate>Sat, 19 Nov 2011 17:37:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>PDFs mit Passwort versehen unter KDE 4</title>
		<link>http://www.simplylinux.ch/pdfs-mit-passwort-versehen-unter-kde-4</link>
		<comments>http://www.simplylinux.ch/pdfs-mit-passwort-versehen-unter-kde-4#comments</comments>
		<pubDate>Thu, 01 Sep 2011 14:19:29 +0000</pubDate>
		<dc:creator>hyper_ch</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[hyper_ch]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[kdialog]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[service menu]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://www.simplylinux.ch/?p=415</guid>
		<description><![CDATA[Heute tauchte auf der Arbeit die Frage auf, wie man denn bequem ein PDF mit einem Passwort versehen könnte um es &#8220;sicher&#8221; übers Internet zu verschicken. Die einzige sichere Möglichkeit meiner Meinung nach, wäre halt das Email samt Anhang zu verschlüsseln. Aber das stösst im Geschäftsbereich halt auch auf gewisse Probleme. Obwohl, mit der SuisseID [...]]]></description>
			<content:encoded><![CDATA[<p>Heute tauchte auf der Arbeit die Frage auf, wie man denn bequem ein PDF mit einem Passwort versehen könnte um es &#8220;sicher&#8221; übers Internet zu verschicken. Die einzige sichere Möglichkeit meiner Meinung nach, wäre halt das Email samt Anhang zu verschlüsseln. Aber das stösst im Geschäftsbereich halt auch auf gewisse Probleme. Obwohl, mit der SuisseID sollte das ja in Zukunft bald mal beseitigt sein.</p>
<p>Zuerst dachte ich, Okular müsste das sicherlich können, denn Okular kann ja auch ausgefüllte Formulare in PDFs speichern. Fehlanzeige!</p>
<p>Also istder nächste Weg gewesen ein Shellscript zu basteln, da ich auch über Google nicht fündig wurde. Das war relativ einfach. Jedoch gibts ein Problem. Nicht jeder mag die Kommandozeile.</p>
<p>Blieb mir also nichts weiter übrig als das irgendwie unter KDE zu machen.</p>
<p><span id="more-415"></span></p>
<p>Ich dachte mir, bequem wäre es, wenn man einfach ein PDF rechts anklicken könnte, dann ein Kontextmenu auswählen, Passwort eingeben und gut ist.</p>
<p>Ich bin dann relativ schnell in den Service Menu Seiten und KDE Dialog gelandet:</p>
<p><a href="http://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus" title="http://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus">http://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus</a><br />
<a href="http://techbase.kde.org/Development/Tutorials/Shell_Scripting_with_KDE_Dialogs" title="http://techbase.kde.org/Development/Tutorials/Shell_Scripting_with_KDE_Dialogs">http://techbase.kde.org/Development/Tutorials/Shell_Scripting_with_KDE_Dialogs</a></p>
<p>Das hat geholfen. Als war die Aufgabe nur noch, das Shellscript in das Service Menu korrekt einzubinden. Zuerst musste ich das Service Menu Verzeichnis erstellen:</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">mkdir</span> <span class="re5">-P</span> ~<span class="sy0">/</span>.kde<span class="sy0">/</span>share<span class="sy0">/</span>kde4<span class="sy0">/</span>services<span class="sy0">/</span>ServiceMenus</pre></div></div>
<p>Danach habe ich einen neue Eintrag angelegt:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">touch</span> ~<span class="sy0">/</span>.kde<span class="sy0">/</span>share<span class="sy0">/</span>kde4<span class="sy0">/</span>services<span class="sy0">/</span>ServiceMenus<span class="sy0">/</span>addPDFPasswd.desktop</pre></div></div>
<p>und schlussendlich mit einigem Probieren die .desktop Datei mit folgendem Inhalt gefüllt:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="br0">&#91;</span>Desktop Entry<span class="br0">&#93;</span>
<span class="re2">Type</span>=Service
<span class="re2">ServiceTypes</span>=KonqPopupMenu<span class="sy0">/</span>Plugin
<span class="re2">MimeType</span>=application<span class="sy0">/</span>pdf;
<span class="re2">Actions</span>=addPDFPasswd
&nbsp;
<span class="br0">&#91;</span>Desktop Action addPDFPasswd<span class="br0">&#93;</span>
<span class="re2">Name</span>=Add Password to PDF
Name<span class="br0">&#91;</span>de<span class="br0">&#93;</span>=Passwort zu PDF hinzufügen
<span class="re2">Icon</span>=application-pdf
<span class="re2">Exec</span>=<span class="sy0">/</span>bin<span class="sy0">/</span><span class="kw2">bash</span> <span class="re5">-c</span> <span class="st_h">'InputFile=&quot;$0&quot;; TmpFile=&quot;/tmp/ServiceMenu_addPDFPasswd.pdf&quot;; Program=&quot;pdftk&quot;; if command -v $Program &gt; /dev/null 2&gt;&amp;1 ; then Passwd=`kdialog --password &quot;Set password for the PDF:&quot;`; $Program &quot;$InputFile&quot; output &quot;$TmpFile&quot; user_pw &quot;$Passwd&quot;; mv &quot;$InputFile&quot; &quot;$InputFile.org&quot;; mv &quot;$TmpFile&quot; &quot;$InputFile&quot;; kdialog --msgbox &quot;Password added to selected File\nOriginal was was renamed to .old&quot;; else kdialog --error &quot;$Program could not be found. Please install $Program&quot;; fi'</span> <span class="sy0">%</span>u
&nbsp;
<span class="co0">########################################### The actual script shown nicely #######################################</span>
<span class="co0">#</span>
<span class="co0">#</span>
<span class="co0">#InputFile=&quot;$0&quot;;</span>
<span class="co0">#TmpFile=&quot;/tmp/ServiceMenu_addPDFPasswd.pdf&quot;;</span>
<span class="co0">#Program=&quot;pdftk&quot;;</span>
<span class="co0">#if command -v $Program &gt; /dev/null 2&gt;&amp;1 ;</span>
<span class="co0">#then</span>
<span class="co0">#       Passwd=`kdialog --password &quot;Set password for the PDF:&quot;`;</span>
<span class="co0">#       $Program &quot;$InputFile&quot; output &quot;$TmpFile&quot; user_pw &quot;$Passwd&quot;;</span>
<span class="co0">#       mv &quot;$InputFile&quot; &quot;$InputFile.org&quot;;</span>
<span class="co0">#       mv &quot;$TmpFile&quot; &quot;$InputFile&quot;;</span>
<span class="co0">#       kdialog --msgbox &quot;Password added to selected File\nOriginal was was renamed to .old&quot;;</span>
<span class="co0">#else</span>
<span class="co0">#       kdialog --error &quot;$Program could not be found. Please install $Program&quot;;</span>
<span class="co0">#fi' %u</span></pre></div></div>
<p>Das Script macht nichts anderes als zuerst zu prüfen, ob pdftk installiert ist, falls ja, dann mache es ein passwortgeschütztes PDF im /tmp Verzeichnis, benennt das Orginal PDF um und verschiebt das passwortgeschützte PDF an die Stelle wo zuvor das Original PDF war.</p>
<p>Sollte pdftk nicht installiert sein, kommt eine Fehlermeldung.</p>
<p>Leider musste ich feststellen, dass der Exec Befehl keine Mehrzeiligen Bash Eingaben mag. Deswegen habe ich das eigentlich Script für die bessere Leserlichkeit nochmals unten angefügt udn auskommentiert. Wenn ich was ändern will, mache ich das im schönen Script und zieh dann alles auf eine Zeile zusammen.</p>
<p>Ebenfalls musste ich feststellen, dass KDE offenbar den Inhalt des Scripts einige Zeit speichert. D.h. wenn die .desktop Datei editiert worden ist, muss noch etwas Geduld geübt werden&#8230; 10 Sekunden sollten reichen&#8230; und dann kann das geänderte Script via Rechtsklick -> Action ausgeführt werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simplylinux.ch/pdfs-mit-passwort-versehen-unter-kde-4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDF Passwort Management unter Linux &#8211; wie entferne ich das Passwort</title>
		<link>http://www.simplylinux.ch/pdf-passwort-management-unter-linux-wie-entferne-ich-das-passwort</link>
		<comments>http://www.simplylinux.ch/pdf-passwort-management-unter-linux-wie-entferne-ich-das-passwort#comments</comments>
		<pubDate>Thu, 24 Jun 2010 07:31:27 +0000</pubDate>
		<dc:creator>hyper_ch</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[hyper_ch]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[password removal]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdf password]]></category>
		<category><![CDATA[pdftk]]></category>
		<category><![CDATA[qpds]]></category>

		<guid isPermaLink="false">http://www.simplylinux.ch/?p=360</guid>
		<description><![CDATA[Ich habe beim Ausländeramt St. Gallen Akteneinsicht in einen Fall beantragt. Vorbildlich haben die die ganzen Akten online. Nur das dumme es, es braucht drei verschiedene Passwörter. Ein Passwort um sich zuerst auf der Plattform authentifizieren zu können. Dann ein zweites Passwort um die PDFs herunter zu laden und schlussendlich noch ein drittes Passwort um [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe beim Ausländeramt St. Gallen Akteneinsicht in einen Fall beantragt. Vorbildlich haben die die ganzen Akten online. Nur das dumme es, es braucht drei verschiedene Passwörter. Ein Passwort um sich zuerst auf der Plattform authentifizieren zu können. Dann ein zweites Passwort um die PDFs herunter zu laden und schlussendlich noch ein drittes Passwort um das PDF überhaupt öffnen zu können. Aus der Perspektive &#8220;Sicherheit&#8221; ist das sicherlich interessant. Allerdings finde ich die drei Passwörter ein bisschen Overkill.</p>
<p>Da es mir zu lästig ist, jedesmal das Passwort einzugeben wenn ich das PDF öffnen will, habe ich mich mal umgeschaut wie man diese Problem beseitigt. Gut, ich könnte natürlich in Okular das Passwort speichern lassen, aber das ist nicht wirklich mein gewünschtes Ziel.</p>
<p>Ich bin dabei auf zwei Tools gestossen, die dabei behilflich sind.</p>
<p><span id="more-360"></span></p>
<h2>pdftk</h2>
<p>pdftk hat mir schon <a href="http://www.simplylinux.ch/pdfs-zusammenfuegen-splitten-via-command-line">hier</a> gute Dienste erwiesen und bietet ausser das Passwort Remove Funktion noch vieles andere an.</p>
<p>Nachfolgend der Code wie man das Passwort entfernen kann:</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">pdftk INPUT.pdf input_pw PASSWORD output OUTPUT.pdf</pre></div></div>
<p>Hiermit wird das INPUT.pdf eingelesen und kann mit dem PASSWORT geöffnet werden und wird sodann als OUTPUT.pdf gespeichert. Allerdings wird dazu das Owner Passwort gebraucht und nicht nur das Benutzer Passwort. Das Ausländeramt St. Gallen gibt freundlicherweise das Owner Passwort bekannt und somit funktioniert pdftk gut.</p>
<h2>QPDF</h2>
<p>QPDF ist ein anderes PDF Tool welches auch Passwörter entfernen kann. Der Vorteil davon ist, dass es kein Java benötigt und eigentlich auch alle anderen PDF Attribute beibehält. Auch hier ist das Passwort entfernen denkbar einfach:</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">qpdf <span class="re5">--password</span>=PASSWORD <span class="re5">--decrypt</span> INPUT.pdf OUTPUT.pdf</pre></div></div>
<p>Die Syntax dürfte auch leicht verständlich sein.</p>
<h2>Fazit</h2>
<p>Ich habe mit qpdf nicht so grosse Erfahrung, soweit ich es aber gebraucht habe scheint es zuverlässig zu sein. Dennoch bevorzuge ich pdftk, da ich das Programm einfach besser kenne.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simplylinux.ch/pdf-passwort-management-unter-linux-wie-entferne-ich-das-passwort/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDFs zusammenfügen / splitten via Command Line</title>
		<link>http://www.simplylinux.ch/pdfs-zusammenfuegen-splitten-via-command-line</link>
		<comments>http://www.simplylinux.ch/pdfs-zusammenfuegen-splitten-via-command-line#comments</comments>
		<pubDate>Tue, 04 May 2010 07:46:14 +0000</pubDate>
		<dc:creator>hyper_ch</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[hyper_ch]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdf combine]]></category>

		<guid isPermaLink="false">http://www.simplylinux.ch/?p=334</guid>
		<description><![CDATA[Ab und zu muss ich verschiedene PDFs in ein Dokument zusammen fügen oder auch wieder teilen. Allerdings gibt es, nach meinem Wissensstand, keine guten OpenSource Gui Tools. Wer hingegen von der Command Line nicht abgeschreckt wird, kann dies mit einfachen Mitteln bewerkstelligen. Ghostscript Mit Ghostscript kann man einfach mehrere PDFs zusammen fügen. Dies dazu einfach [...]]]></description>
			<content:encoded><![CDATA[<p>Ab und zu muss ich verschiedene PDFs in ein Dokument zusammen fügen oder auch wieder teilen. Allerdings gibt es, nach meinem Wissensstand, keine guten OpenSource Gui Tools. Wer hingegen von der Command Line nicht abgeschreckt wird, kann dies mit einfachen Mitteln bewerkstelligen.</p>
<p><span id="more-334"></span></p>
<h2>Ghostscript</h2>
<p>Mit Ghostscript kann man einfach mehrere PDFs zusammen fügen. Dies dazu einfach folgenden Befehl eingeben:<br />
<div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">gs</span> <span class="re5">-dNOPAUSE</span> <span class="re5">-sDEVICE</span>=pdfwrite <span class="re5">-sOUTPUTFILE</span>=combined.pdf <span class="re5">-dBATCH</span> 1.pdf 2.pdf 3.pdf</pre></div></div><br />
Dies würde die Dateien 1.pdf 2.pdf 3.pdf zusammenführen und neu combined.pdf erschaffen.<br />
Allerdings muss dazu zuerst Ghostscript installiert werden:<br />
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> <span class="kw2">gs</span></pre></div></div></p>
<p>Wenn man das häufiger gebrauchen möchte, dann kann man auch ein Shell Script errichten:<br />
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">touch</span> <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>bin<span class="sy0">/</span>combinepdf
<span class="kw2">sudo</span> <span class="kw2">chmod</span> 0755 <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>bin<span class="sy0">/</span>combinepdf
<span class="kw2">sudo</span> <span class="kw2">nano</span> <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>bin<span class="sy0">/</span>combinepdf</pre></div></div><br />
Und dann folgenden Inhalt einfügen:<br />
<div id="wpshdo_9" class="wp-synhighlighter-outer"><div id="wpshdt_9" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_9"></a><a id="wpshat_9" class="wp-synhighlighter-title" href="#codesyntax_9"  onClick="javascript:wpsh_toggleBlock(9)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_9" onClick="javascript:wpsh_code(9)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_9" onClick="javascript:wpsh_print(9)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_9" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="co0">#!/bin/bash</span>
<span class="kw2">gs</span> <span class="re5">-dNOPAUSE</span> <span class="re5">-sDEVICE</span>=pdfwrite <span class="re5">-sOUTPUTFILE</span>=combined.pdf <span class="re5">-dBATCH</span> $<span class="sy0">@</span></pre></div></div><br />
Die Ausgabedatei heisst hierbei wiederum combined.pdf und es können beliebig viele Dateien hinzugefügt werden.</p>
<p>Aufgerufen wird das dann folgendermassen:<br />
<div id="wpshdo_10" class="wp-synhighlighter-outer"><div id="wpshdt_10" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_10"></a><a id="wpshat_10" class="wp-synhighlighter-title" href="#codesyntax_10"  onClick="javascript:wpsh_toggleBlock(10)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_10" onClick="javascript:wpsh_code(10)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_10" onClick="javascript:wpsh_print(10)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_10" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">combinepdf 1.pdf 2.pdf 3.pdf</pre></div></div></p>
<p>Ich musste allerdings feststellen, dass Ghostscript bei eingescannten Bildern via XSane ein paar Schwierigkeiten hatte, aber ansonsten läuft es gut.</p>
<h2>pdftk</h2>
<p>pdftk beschreibt sich eigentlich als Schweizer Offiziersmesser für den Umgang mit PDF Dokumenten. <a href='http://www.accesspdf.com/pdftk/' target='_blank'>Hier</a> sind entsprechende Infos vorhanden.</p>
<p>Auch pdftk muss zuerst installiert werden:<br />
<div id="wpshdo_11" class="wp-synhighlighter-outer"><div id="wpshdt_11" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_11"></a><a id="wpshat_11" class="wp-synhighlighter-title" href="#codesyntax_11"  onClick="javascript:wpsh_toggleBlock(11)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_11" onClick="javascript:wpsh_code(11)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_11" onClick="javascript:wpsh_print(11)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_11" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> pdftk</pre></div></div></p>
<p>Danach eröffnet es eine ganze Fülle an Möglichkeiten mit dem Umgang mit PDFs. Ich habe nachfolgend ein paar Beispiele aufgelistet:</p>
<p>Will man mehrere PDFs in eines zusammenführen, gibt man folgenden Befehl ein:<br />
<div id="wpshdo_12" class="wp-synhighlighter-outer"><div id="wpshdt_12" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_12"></a><a id="wpshat_12" class="wp-synhighlighter-title" href="#codesyntax_12"  onClick="javascript:wpsh_toggleBlock(12)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_12" onClick="javascript:wpsh_code(12)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_12" onClick="javascript:wpsh_print(12)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_12" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">pdftk 1.pdf 2.pdf 3.pdf <span class="kw2">cat</span> output 123.pdf</pre></div></div></p>
<p>Ebenfalls kann man auch Wildcards verwenden (praktisch wenn man alle PDFs in einem Verzeichnis in ein neues zusammenführen will):<br />
<div id="wpshdo_13" class="wp-synhighlighter-outer"><div id="wpshdt_13" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_13"></a><a id="wpshat_13" class="wp-synhighlighter-title" href="#codesyntax_13"  onClick="javascript:wpsh_toggleBlock(13)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_13" onClick="javascript:wpsh_code(13)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_13" onClick="javascript:wpsh_print(13)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_13" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">pdftk <span class="sy0">*</span>.pdf <span class="kw2">cat</span> output combined.pdf</pre></div></div></p>
<p>Anstelle der Dokumentennamen kann man auch Handlers verwenden:<br />
<div id="wpshdo_14" class="wp-synhighlighter-outer"><div id="wpshdt_14" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_14"></a><a id="wpshat_14" class="wp-synhighlighter-title" href="#codesyntax_14"  onClick="javascript:wpsh_toggleBlock(14)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_14" onClick="javascript:wpsh_code(14)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_14" onClick="javascript:wpsh_print(14)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_14" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">pdftk <span class="re2">A</span>=1.pdf <span class="re2">B</span>=2.pdf <span class="kw2">cat</span> A B output 12.pdf</pre></div></div></p>
<p>Die Handlers werden dann praktisch, wenn man verschiedene Seiten eines PDFs oder aus verschiedene Seiten aus mehreren PDFs in ein neues zusammenführen will:<br />
<div id="wpshdo_15" class="wp-synhighlighter-outer"><div id="wpshdt_15" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_15"></a><a id="wpshat_15" class="wp-synhighlighter-title" href="#codesyntax_15"  onClick="javascript:wpsh_toggleBlock(15)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_15" onClick="javascript:wpsh_code(15)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_15" onClick="javascript:wpsh_print(15)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_15" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">pdftk <span class="re2">A</span>=one.pdf <span class="re2">B</span>=two.pdf <span class="kw2">cat</span> A1-<span class="nu0">7</span> B1-<span class="nu0">5</span> A8 output combined.pdf</pre></div></div></p>
<h2>Schlussbemerkung</h2>
<p>Während Ghostscript von der Syntax her nicht einfach zu gebrauchen ist, ist es aber dennoch praktisch wenn man sich ein entsprechendes Shell Script erstellt. pdftk hingegen ist von Haus aus einfach zu gebrauchen und bietet auch viel mehr Möglichkeiten als die Ghostscript Variante.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simplylinux.ch/pdfs-zusammenfuegen-splitten-via-command-line/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

