<?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>hubionmac.com &#187; pdf</title> <atom:link href="http://hubionmac.com/wordpress/category/softwareschmiede/pdf-softwareschmiede/feed/" rel="self" type="application/rss+xml" /><link>http://hubionmac.com/wordpress</link> <description>script the unscriptable</description> <lastBuildDate>Fri, 03 Feb 2012 22:41:10 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>PDF: Dynamisches Wasserzeichen mit SVG-&gt;PDF Overlay</title><link>http://hubionmac.com/wordpress/2011/12/pdf-dynamisches-wasserzeichen-mit-svg-pdf-overlay/</link> <comments>http://hubionmac.com/wordpress/2011/12/pdf-dynamisches-wasserzeichen-mit-svg-pdf-overlay/#comments</comments> <pubDate>Sun, 11 Dec 2011 01:16:27 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[pdf]]></category> <category><![CDATA[Useful Snippets]]></category> <category><![CDATA[convert]]></category> <category><![CDATA[inkscape]]></category> <category><![CDATA[svg]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=3012</guid> <description><![CDATA[Ich habe einen neuen Trick gefunden automatisch PDFs zu erstellen, ohne dabei auf allzu teure (Indesign, Quark), komplizierte (ruby pawn z.B.) oder nicht gerade performante Tools (Pages, Word) angewiesen zu sein. SVG-Dateien sind quasi nichts anderes als XML bzw. Text-Dateien, und lassen sich leicht per Skript manipulieren. Zudem lassen sich auch exakte Format-Angabe (A4, Letter [...]]]></description> <content:encoded><![CDATA[<p>Ich habe einen neuen Trick gefunden automatisch PDFs zu erstellen, ohne dabei auf allzu teure (Indesign, Quark), komplizierte (ruby pawn z.B.) oder nicht gerade performante Tools (Pages, Word) angewiesen zu sein. SVG-Dateien sind quasi nichts anderes als XML bzw. Text-Dateien, und lassen sich leicht per Skript manipulieren. Zudem lassen sich auch exakte Format-Angabe (A4, Letter usw.) definieren.</p><p> Das Wandeln von SVG in PDF übernimmt dann <a href="http://www.macupdate.com/app/mac/18954/inkscape" title="Inkscape bei Macupdate.com" target="_blank">Inkscape</a> und zwar als Shell-Anwendung. Auf diese Art lassen sich schnell (ohne GUI) PDFs erstellen, die anders als bei der <a href="http://hubionmac.com/wordpress/?p=2984" title="Lösung die html und wkpdf nutzt um PDFs zu erstellen" target="_blank">wkpdf-Lösung</a> auch über einen Transparente Hintergrund verfügen. <br /> Ich habe jetzt kein direktes Beispiel zur Hand, verweise aber mal <code>/Applications/Inkscape.app/Contents/Resources/bin/inkscape-bin --help</code></p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2011/12/pdf-dynamisches-wasserzeichen-mit-svg-pdf-overlay/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>PDF: Dynamisches Wasserzeichen mit HTML-&gt;PDF Overlay</title><link>http://hubionmac.com/wordpress/2011/12/pdf-dynamisches-wasserzeichen-mit-html-pdf-overlay/</link> <comments>http://hubionmac.com/wordpress/2011/12/pdf-dynamisches-wasserzeichen-mit-html-pdf-overlay/#comments</comments> <pubDate>Fri, 09 Dec 2011 04:39:57 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[Nice2Know]]></category> <category><![CDATA[pdf]]></category> <category><![CDATA[pdft]]></category> <category><![CDATA[wkpdf]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2984</guid> <description><![CDATA[Bevor ihr weiterlest (Update: 11.12.2011): Das mit dem HTML-Dokument als Print-Vorlage war nur ein ehr mittelmäßiger Ansatz&#8230; glücklicherweise hat sich eine neue Möglichkeit aufgetan, wie man PDFs von einer besseren Formatvorlage (SVG) erstellen kann. Mehr dazu]]></description> <content:encoded><![CDATA[<h3>Bevor ihr weiterlest (Update: 11.12.2011):</h3><p>Das mit dem HTML-Dokument als Print-Vorlage war nur ein ehr mittelmäßiger Ansatz&#8230; glücklicherweise hat sich eine neue Möglichkeit aufgetan, wie man PDFs von einer besseren Formatvorlage (SVG) erstellen kann. Mehr dazu <a href="http://hubionmac.com/wordpress/?p=3012" title="PDF: Dynamisches Wasserzeichen mit SVG->PDF Overlay&#8221; target=&#8221;_blank&#8221;>hier</a></p><div class="2columns"><p>Ich habe eine relative <em>elegante</em> Lösung gefunden, wie man PDFs mit ein paar Tricks mit dynamischen Wasserzeichen versehen kann. Bei der ursprünglichen Aufgabenstellung wollte jemand Daten aus einem Numbers-Sheet auslesen und dementsprechend Logos und Texte als Wasserzeichen zu PDFs hinzufügen.</p><p>Das mit dem Wasserzeichen ist ja mit pdftk recht leicht zu bewerkstelligen und auch das abgleichen der Daten mit den PDF-Namen war ein leichtes. Etwas schwieriger war da schon das automatische Layouten der Datensätze in ein PDF. Man kann so etwas bestimmt mit Quark oder Indesign machen, nur stehen mir diese Programme leider nicht zu Verfügung und zudem produzieren die Dinger einen ganz schönen Overhead und der Rechner ist in der Zeit komplett blockiert.</p><p>Stattdessen habe ich mir für einen günstigere Variante (php, ruby-> wkpdf) quergedacht, da die PDFs sowieso nur für den Online-Gebrauch erstellt werden sollen und nicht für den Druck.</p></div><p><span id="more-2984"></span><br /><hr /><h3>Die notwendigen Tools:</h3><ul><li>Zunächst installiert man sich pdftk (am besten direkt von <a href="http://www.pdflabs.com/docs/install-pdftk/" target="_blank" title="pdftk">hier</a>, denn da gibt es einen gebrauchsfertigen Installier (funktioniert für 10.6 und 10.7)</li><li>nun braucht man noch <a href="http://plessl.github.com/wkpdf/" target="_blank" title="wkdpf">wkdpf</a>, ein Ruby-Gem, mit dem man HTML-Seiten als PDF rendern lassen kann. Dazu wird die WebkitEngine genutzt<br />Die Installation erfolgt einfach über das eine Code-Zeile im Terminal:<code>sudo gem update --system; sudo gem install wkpdf;gem update wkpdf</code></li><li>Eine dynamisch anpassbare HTML-Datei, über die das Layout des PDF-Overlays definiert wird. Ich habe hierzu anfänglich PHP genutzt, im Beispiel nutze ich stattdessen schnödes AppleScript, welches eine HTML-Datei ausliest und diese angepasst ausgibt.</li></ul><h3>Ein Beispiel</h3><p>Anbei eine Zip-Datei mit einem Beispiel-Skript. Die Funktionsweise ist einfach gehalten:</p><ol><li>Skript starten und wählt auf Nachfrage ein PDF und die HTML-Datei aus</li><li>Nun wird noch der Inhalt der zu erzeugenden Überschrift abgefragt</li><li>Die eingegebenen Überschrift wird zusammen mit dem aktuellen Datum in das HTML-Layout eingebaut und in eine Datei geschrieben (quick&#038;dirty)</li><li>wkpdf schnappt sich die HTML-Datei und erstell daraus ein PDF</li><li>pdftk verwurstet alle in ein neues PDF und dies wir anschließend geöffnet</li></ol> <a class="download_button" href="http://hubionmac.com/wordpress/wp-content/plugins/download-monitor/download.php?id=46" title="Download: serien_pdf_beispiel.zip v.1.0"><span class="title">DOWNLOAD</span><br /><span class="name">serien_pdf_beispiel.zip v.1.0</span><br /> <span class="info">162.84 kB (14 hits)</span></a><div class="hubionmac_codebox"><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;hubionmac 09.12.2011</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;adds a dynamic overlay/background to a pdf</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211; requires:</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211; wkpdf: http://plessl.github.com/wkpdf/</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211; pdftk: http://www.pdflabs.com/docs/install-pdftk/</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211; a working html file with &#8220;blafasel&#8221; place holders for the dynamic data ;-)</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211; tested Mac OS 10.7.2<span class="Apple-converted-space"> </span></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; min-height: 15.0px"></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;wir brauchen die Datei-Pfade und die Daten für das Overlay</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>set</b> <span style="color: #438f2b">thepdf</span> <b>to</b> <span style="color: #8832d3">quoted form</span> <b>of</b> <span style="color: #8832d3">POSIX path</span> <b>of</b> (<span style="color: #0d32b6"><b>choose file</b></span> <span style="color: #0d32b6">of type</span> {&#8220;pdf&#8221;})</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161"><span style="color: #000000"><b>set</b> </span><span style="color: #438f2b">thelayout</span><span style="color: #000000"> <b>to</b> </span><span style="color: #8832d3">quoted form</span><span style="color: #000000"> <b>of</b> </span><span style="color: #8832d3">POSIX path</span><span style="color: #000000"> <b>of</b> (</span><span style="color: #0d32b6"><b>choose file</b></span><span style="color: #000000">) </span>&#8211;of type &#8220;html funktioniert irgendwie nicht</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>set</b> <span style="color: #438f2b">headline</span> <b>to</b> <span style="color: #5c32b6">text returned</span> <b>of</b> (<span style="color: #0d32b6"><b>display dialog</b></span> &#8220;Bitte Überschrift eingeben:&#8221; <span style="color: #0d32b6">default answer</span> &#8220;Toller Titel&#8221;)</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>set</b> <span style="color: #438f2b">thedate</span> <b>to</b> <span style="color: #0d32b6"><b>do shell script</b></span> &#8220;date &#8216;+Datum:<span class="Apple-converted-space">  </span>%d.%m.%Y&#8217;&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #438f2b"><span style="color: #000000"><b>set</b> </span>thedata<span style="color: #000000"> <b>to</b> {</span>headline<span style="color: #000000">, </span>thedate<span style="color: #000000">}</span></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; min-height: 15.0px"></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;Die Daten werden in den HTML-Code eingebaut</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #438f2b"><span style="color: #000000"><b>set</b> </span>htmlsource<span style="color: #000000"> <b>to</b> </span><span style="color: #0d32b6"><b>do shell script</b></span><span style="color: #000000"> &#8220;cat &#8221; &amp; </span>thelayout</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #8832d3"><span style="color: #000000"><b>set</b> </span>AppleScript<span style="color: #000000">&#8216;s </span>text item delimiters<span style="color: #000000"> <b>to</b> &#8220;blafasel&#8221;</span></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #438f2b"><span style="color: #000000"><b>set</b> </span>htmlparts<span style="color: #000000"> <b>to</b> <b>every</b> </span><span style="color: #1b39f5"><i>text item</i></span><span style="color: #000000"> <b>of</b> </span>htmlsource</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #8832d3"><span style="color: #000000"><b>set</b> </span>AppleScript<span style="color: #000000">&#8216;s </span>text item delimiters<span style="color: #000000"> <b>to</b> &#8220;&#8221;</span></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>set</b> <span style="color: #438f2b">myoutput</span> <b>to</b> {}</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>repeat</b> <b>with</b> <span style="color: #438f2b">i</span> <b>from</b> 1 <b>to</b> <span style="color: #1b39f5"><b>count</b></span> <b>of</b> <span style="color: #438f2b">thedata</span></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana; color: #438f2b"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> </span>myoutput<span style="color: #000000"> <b>to</b> </span>myoutput<span style="color: #000000"> &amp; </span><span style="color: #1b39f5"><i>item</i></span><span style="color: #000000"> </span>i<span style="color: #000000"> <b>of</b> </span>htmlparts<span style="color: #000000"> &amp; </span><span style="color: #1b39f5"><i>item</i></span><span style="color: #000000"> </span>i<span style="color: #000000"> <b>of</b> </span>thedata</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>end</b> <b>repeat</b></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>if</b> (<span style="color: #1b39f5"><b>count</b></span> <b>of</b> <span style="color: #438f2b">htmlparts</span>) &gt; (<span style="color: #1b39f5"><b>count</b></span> <b>of</b> <span style="color: #438f2b">thedata</span>) <b>then</b></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #438f2b">myoutput</span> <b>to</b> <span style="color: #438f2b">myoutput</span> &amp; <span style="color: #1b39f5"><i>items</i></span> (<span style="color: #1b39f5"><b>count</b></span> <b>of</b> <span style="color: #438f2b">thedata</span>) <b>through</b> -1 <b>of</b> <span style="color: #438f2b">htmlparts</span></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>end</b> <b>if</b></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; min-height: 15.0px"></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;der angepasste HTML-Code wir in eine Datei geschrieben</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><span style="color: #0d32b6"><b>do shell script</b></span> &#8220;echo &#8221; &amp; <span style="color: #8832d3">quoted form</span> <b>of</b> (<span style="color: #438f2b">myoutput</span> <b>as</b> <span style="color: #1b39f5"><i>text</i></span>) &amp; &#8221; &gt; &#8221; &amp; <span style="color: #438f2b">thelayout</span> &amp; &#8220;.data.html&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;wkpdf erstellt aus dieser Datei ein PDF</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><span style="color: #0d32b6"><b>do shell script</b></span> &#8220;wkpdf &#8211;output &#8221; &amp; <span style="color: #438f2b">thelayout</span> &amp; &#8220;.data.pdf &#8211;source &#8221; &amp; <span style="color: #438f2b">thelayout</span> &amp; &#8220;.data.html &#8211;paper a4 &#8211;orientation portrait &#8211;print-background &#8211;paginate false&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;PDFTK nimmt sich das erstellte PDF und fügt es als background zum eigentlichen PDF hinzu und am Ende wird das Ergebnis im geöffnet</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><span style="color: #0d32b6"><b>do shell script</b></span> &#8220;/opt/pdflabs/pdftk/bin/pdftk &#8221; &amp; <span style="color: #438f2b">thepdf</span> &amp; &#8221; background &#8221; &amp; <span style="color: #438f2b">thelayout</span> &amp; &#8220;.data.pdf output &#8221; &amp; <span style="color: #438f2b">thepdf</span> &amp; &#8220;.overlayed.pdf flatten;open &#8221; &amp; <span style="color: #438f2b">thepdf</span> &amp; &#8220;.overlayed.pdf&#8221;</p></div><h3>Wissenswert</h3><div class="2columns"><p>Der einzige richtige Stolperstein ist eigentlich das HTML-Style-Sheet und die Parameter von wkpdf.<br /> Das Layout der HTML-Datei sollte am besten exakt der Größe des Ausgangs-PDFs angepasst werden und wkpdf sollte die richtige Größe <em>-paper, -margin, &#8211;orientation</em> mitbekommen… insbesondere der Parameter <em>&#8211;paginate false</em> macht einem das ganze leichter, da so der Output (also das Wasserzeichen) stets nur aus einer Seite besteht.</p><p>Bei pdftk muss man sehen wie das am besten funktioniert ob mit <em>stamp</em> oder <em>background</em>. Das PDF von wkdpf ist glücklicherweise transparent, bis auf die Bereich mit HTML-Objekten, die weisen anscheinend stets einen Hintergrund auf.</p></div> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2011/12/pdf-dynamisches-wasserzeichen-mit-html-pdf-overlay/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>ISBN Nummern aus PDFs auslesen</title><link>http://hubionmac.com/wordpress/2011/04/isbn-nummern-aus-pdfs-auslesen/</link> <comments>http://hubionmac.com/wordpress/2011/04/isbn-nummern-aus-pdfs-auslesen/#comments</comments> <pubDate>Sat, 30 Apr 2011 10:25:08 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[pdf]]></category> <category><![CDATA[Useful Snippets]]></category> <category><![CDATA[scan]]></category> <category><![CDATA[text]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2812</guid> <description><![CDATA[Ist eigentlich nur ein Beispiel, wie man recht ohne großen Overhead (gs mal vorausgesetzt) PDFs auslesen kann&#8230; vielleicht kennt ja jemand noch ein simplere Lösung: &#8211;30.04.2011 hubionmac.com &#8211;quick &#38; dirty script to extract first ISBN-Number of a PDF file&#8230; just uses grep, maybe some nice reqexp would do a better job! set myselection to choose [...]]]></description> <content:encoded><![CDATA[<p>Ist eigentlich nur <a href="https://discussions.apple.com/thread/3018220?tstart=0">ein Beispiel,</a> wie man recht ohne großen Overhead (gs mal vorausgesetzt) PDFs auslesen kann&#8230; vielleicht kennt ja jemand noch ein simplere Lösung:</p><div class="hubionmac_codebox"><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;30.04.2011 hubionmac.com</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #5e6161">&#8211;quick &amp; dirty script to extract first ISBN-Number of a PDF file&#8230; just uses grep, maybe some nice reqexp would do a better job!</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; min-height: 15.0px"></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #172fb9"><span style="color: #000000"><b>set</b> </span><span style="color: #3b9120">myselection</span><span style="color: #000000"> <b>to</b> </span><b>choose file</b><span style="color: #000000"> </span>of type<span style="color: #000000"> {&#8220;pdf&#8221;} <b>with</b> </span>multiple selections allowed</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>set</b> <span style="color: #3b9120">myoutput</span> <b>to</b> &#8220;&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; color: #3b9120"><span style="color: #000000"><b>repeat</b> <b>with</b> </span>pdf_file<span style="color: #000000"> <b>in</b> </span>myselection</p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;Finder&#8221; <b>to</b> <b>set</b> <span style="color: #3b9120">pdfname</span> <b>to</b> <span style="color: #8c27d6">name</span> <b>of</b> (<span style="color: #3b9120">pdf_file</span> <b>as</b> <span style="color: #2832f9"><i>alias</i></span>)</p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">pdf_file_posix</span> <b>to</b> <span style="color: #8c27d6">quoted form</span> <b>of</b> <span style="color: #8c27d6">POSIX path</span> <b>of</b> (<span style="color: #3b9120">pdf_file</span> <b>as</b> <span style="color: #2832f9"><i>alias</i></span>)</p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana; color: #172fb9"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span></span><b>do shell script</b><span style="color: #000000"> &#8220;&#8221;</span></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>try</b></p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana; color: #5e6161"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span></span>&#8211;first add the path, otherwhise s2ascii will fail since it cannot find ghostscript (gs) which is also installed in /usr/local/bin (think by macports)</p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">ISBN_String</span> <b>to</b> <span style="color: #172fb9"><b>do shell script</b></span> &#8220;PATH=\&#8221;$PATH:/usr/local/bin\&#8221;; /usr/local/bin/ps2ascii &#8221; &amp; <span style="color: #3b9120">pdf_file_posix</span> &amp; &#8221; | grep -m 1 ISBN&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">foundLine</span> <b>to</b> <span style="color: #642f8e">true</span></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>on</b> <b>error</b></p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #172fb9"><b>display dialog</b></span> &#8220;maybe \&#8221;" &amp; <span style="color: #3b9120">pdfname</span> &amp; &#8220;\&#8221; does not contain a ISBN at all&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">foundLine</span> <b>to</b> <span style="color: #642f8e">false</span></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>try</b></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>if</b> <span style="color: #3b9120">foundLine</span> <b>is</b> <span style="color: #642f8e">true</span> <b>then</b></p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>repeat</b> <b>with</b> <span style="color: #3b9120">s</span> <b>in</b> <b>every</b> <span style="color: #2832f9"><i>word</i></span> <b>of</b> <span style="color: #3b9120">ISBN_String</span></p><p style="margin: 0.0px 0.0px 0.0px 157.1px; text-indent: -157.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>try</b></p><p style="margin: 0.0px 0.0px 0.0px 196.4px; text-indent: -196.4px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>get</b> <span style="color: #3b9120">s</span> <b>as</b> <span style="color: #2832f9"><i>integer</i></span></p><p style="margin: 0.0px 0.0px 0.0px 196.4px; text-indent: -196.4px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">s</span> <b>to</b> <span style="color: #3b9120">s</span> <b>as</b> <span style="color: #2832f9"><i>text</i></span></p><p style="margin: 0.0px 0.0px 0.0px 196.4px; text-indent: -196.4px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">foundisbn</span> <b>to</b> <span style="color: #642f8e">true</span></p><p style="margin: 0.0px 0.0px 0.0px 196.4px; text-indent: -196.4px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>exit</b> <b>repeat</b></p><p style="margin: 0.0px 0.0px 0.0px 157.1px; text-indent: -157.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>on</b> <b>error</b></p><p style="margin: 0.0px 0.0px 0.0px 196.4px; text-indent: -196.4px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">s</span> <b>to</b> &#8220;&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 157.1px; text-indent: -157.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>try</b></p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>repeat</b></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>if</b></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana; color: #3b9120"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> </span>myoutput<span style="color: #000000"> <b>to</b> </span>myoutput<span style="color: #000000"> &amp; </span>pdfname<span style="color: #000000"> &amp; </span><span style="color: #8c27d6">tab</span><span style="color: #000000"> &amp; </span>s<span style="color: #000000"> &amp; </span><span style="color: #8c27d6">return</span></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>end</b> <b>repeat</b></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana; min-height: 15.0px"></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;TextEdit&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana; color: #2832f9"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span></span><b>activate</b></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana; color: #2832f9"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> </span><span style="color: #3b9120">a</span><span style="color: #000000"> <b>to</b> </span><b>make</b><span style="color: #000000"> </span>new<span style="color: #000000"> </span><i>document</i></p><p style="margin: 0.0px 0.0px 0.0px 78.5px; text-indent: -78.6px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #2832f9"><i>text</i></span> <b>of</b> <span style="color: #3b9120">a</span> <b>to</b> <span style="color: #3b9120">myoutput</span> <b>as</b> <span style="color: #2832f9"><i>text</i></span></p><p style="margin: 0.0px 0.0px 0.0px 39.2px; text-indent: -39.3px; font: 12.0px Verdana"><b>end</b> <b>tell</b></p></div> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2011/04/isbn-nummern-aus-pdfs-auslesen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Kleiner Bugfix in PDF MetaEdit</title><link>http://hubionmac.com/wordpress/2009/09/kleiner-bugfix-in-pdf-metaedit/</link> <comments>http://hubionmac.com/wordpress/2009/09/kleiner-bugfix-in-pdf-metaedit/#comments</comments> <pubDate>Mon, 07 Sep 2009 22:04:43 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[hubionmac.com]]></category> <category><![CDATA[pdf]]></category> <category><![CDATA[Software I Use]]></category> <category><![CDATA[meta edit]]></category> <category><![CDATA[Update]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=1358</guid> <description><![CDATA[PDF MetaEdit Ist ein kleines Tool, dass ich zum Editieren der Meta-Daten von PDFs nutze, damit diese leichter via Spotlight zu finden sind. Heute gab es ein kleine Wartungsupdate, da in Snow-Leopard sich der Terminal-Befehl mv anscheinen etwas anders verhält&#8230;]]></description> <content:encoded><![CDATA[<div style="width: 90%; float: left; padding-right: 10pt; display: inline; text-align: justify;"><img src="http://hubionmac.com/wordpress/wp-content/uploads/2009/09/PDF_MetaEdit-150x150.png" alt="PDF_MetaEdit" title="PDF_MetaEdit" width="150" height="150" class="alignleft size-thumbnail wp-image-1359" /><a href="http://hubionmac.com/wordpress/2009/06/pdfs-mal-schnell-taggen/">PDF MetaEdit</a> Ist ein kleines Tool, dass ich zum Editieren der Meta-Daten von PDFs nutze, damit diese leichter via Spotlight zu finden sind. Heute gab es ein kleine Wartungsupdate, da in Snow-Leopard sich der Terminal-Befehl <em>mv</em> anscheinen etwas anders verhält&#8230;</div><div style="clear: both;"></div> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2009/09/kleiner-bugfix-in-pdf-metaedit/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>PDFs mal schnell Taggen</title><link>http://hubionmac.com/wordpress/2009/06/pdfs-mal-schnell-taggen/</link> <comments>http://hubionmac.com/wordpress/2009/06/pdfs-mal-schnell-taggen/#comments</comments> <pubDate>Thu, 11 Jun 2009 16:46:50 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[pdf]]></category> <category><![CDATA[ready2use]]></category> <category><![CDATA[AppleScript]]></category> <category><![CDATA[keywords]]></category> <category><![CDATA[metadata]]></category> <category><![CDATA[pdftk]]></category> <category><![CDATA[tags]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=931</guid> <description><![CDATA[Ich möchte gerade meinen persönlichen Papierstapel digitalisieren. Dabei hilft mir ein cooler Multi-Funktions-Drucker, der mir die eingescannten Seiten direkt als PDF auf den Rechner kopiert. Jetzt stehe ich nur vor dem Problem, dass ich die Dateien zwar auch entsprechend benennen möchte, aber in erste Linie über Schlagwörter sortieren möchte, die Spotlight ja auch indiziert. Die [...]]]></description> <content:encoded><![CDATA[<div class="2columns"><p>Ich möchte gerade meinen persönlichen Papierstapel digitalisieren. Dabei hilft mir ein cooler Multi-Funktions-Drucker, der mir die eingescannten Seiten direkt als PDF auf den Rechner kopiert. Jetzt stehe ich nur vor dem Problem, dass ich die Dateien zwar auch entsprechend benennen möchte, aber in erste Linie über Schlagwörter sortieren möchte, die Spotlight ja auch indiziert. Die Vorschau (wohl seit 10.4) und auch Adobe Acrobat können diese Keywords in die Metadaten schreiben, nur ist das heftigst umständlich! Da ich für einige PDF-Skripte pdftk installiert habe, habe ich mir kurzerhand ein weiteres Skript-Programm erstellt, mit dem die Meta-Daten von PDF-Dateien leicht abändern lassen. Damit lassen sich vor allen Dingen auch die Schlagworte (Keywords) der PDF-Dateien schön schnell erweitern. Also, bevor das Programm genutzt werden kann, muss pdftk installiert sein. Ein Installer gibt es z.B. <a href="http://hubionmac.com/wordpress/2008/04/pdf-wasserzeichen-die-ii/" target="blank_">hier</a> oder einfach selber über die <a href="http://darwinports.com/" target="blank_">Darwin-Ports</a> kompilieren.<a href="http://hubionmac.com/wordpress/wp-content/uploads/2009/06/Bild-3.png"><img src="http://hubionmac.com/wordpress/wp-content/uploads/2009/06/Bild-3-150x150.png" alt="PDF Meta Edit Screenshot" title="PDF Meta Edit Screenshot" width="150" height="150" class="aligncenter size-thumbnail wp-image-954" /></a><br /><h2>Update v0.2 (07.09.2009):</h2> <a class="download_button" href="http://hubionmac.com/wordpress/wp-content/plugins/download-monitor/download.php?id=25" title="Download: PDF Meta Edit v.0.2"><span class="title">DOWNLOAD</span><br /><span class="name">PDF Meta Edit v.0.2</span><br /> <span class="info">363.71 KB (2374 hits)</span></a><p>Kleiner Bugfix, damit mit PDFs auch korrekt gespeichert werden unter 10.6</p><h2>Updates 15.02.2011</h2><p>Für Snow Leopard gibt es mittlerweile eine <a href="http://www.pdflabs.com/docs/install-pdftk/">fertig kompilierte</a> Version direkt vom &#8220;Hersteller&#8221; von pdftk</p></div> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2009/06/pdfs-mal-schnell-taggen/feed/</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>OSX: PDF drucken, mit Wasserzeichen versehen und per Mail verschicken</title><link>http://hubionmac.com/wordpress/2007/12/osx-pdf-drucken-mit-wasserzeichen-versehen-und-per-mail-verschicken/</link> <comments>http://hubionmac.com/wordpress/2007/12/osx-pdf-drucken-mit-wasserzeichen-versehen-und-per-mail-verschicken/#comments</comments> <pubDate>Sat, 22 Dec 2007 23:35:07 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[pdf]]></category> <category><![CDATA[cups]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[mailx]]></category> <category><![CDATA[OS X]]></category> <category><![CDATA[printing]]></category> <category><![CDATA[stamp]]></category> <category><![CDATA[wasserzeichen]]></category> <category><![CDATA[watermark]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=43</guid> <description><![CDATA[Das ist so ungefair das, was ich machen wollte. Meinen Schriftverkehr (PDF-Ausdrucke), mit meinem Briefpapier versehen und dann per Mail verschicken und dabei möglichst auf AppleScript verzichten, damit auch so etwas wie GUI-Scripting gar nicht erst zum Thema werden könnte :)Die Schritte dazu:- Einrichtung einesPDF-Druckers an, dazu habe ich das CUPS-PDF Package benutzt.- PDFTK installieren, [...]]]></description> <content:encoded><![CDATA[<div style="width: 45%; float: left; padding-right: 10pt; display: inline; text-align: justify;">Das ist so ungefair das, was ich machen wollte. Meinen Schriftverkehr (PDF-Ausdrucke), mit meinem Briefpapier versehen und dann per Mail verschicken und dabei möglichst auf AppleScript verzichten, damit auch so etwas wie GUI-Scripting gar nicht erst zum Thema werden könnte :)Die Schritte dazu:- Einrichtung einesPDF-Druckers an, dazu habe ich das <a href="http://www.codepoetry.net/projects/cups-pdf-for-mosx" target="_blank">CUPS-PDF Package</a> benutzt.- PDFTK installieren, das benutzt man um was Wasserzeichen in die PDFs einzubetten.<a href="http://www.accesspdf.com/pdftk/" target="_blank">pdftk gibt es auf der Seite </a></div><div style="width: 45%; float: left; padding-right: 10pt; display: inline; text-align: justify;">als Installations-Package für 10.3 und 10.4, nur kann diese Version nur ein Hintergrund-Image einfügen und nicht ein PDF mit einem andere &#8220;stempeln&#8221;. Das ist aber oft notwendig, da sonst das eigentlich PDF das Briefpapier (z.B. ein Ausdruck aus Pages) vollkommen verdeckt .Also braucht man eine neuere Version und die muss kompiliert werden, was sehr einfach geht sofern man Xcode (gcc compiler) und die <a href="http://darwinports.com/" target="_blank">darwin ports</a> installiert hat.Dazu muss braucht man nur das hier eingeben</div><div style="clear: both;"></div><p><code>sudo port install pdftk</code><br /> und Zeit haben, denn das kompilieren braucht einiges an Zeit.Ist die Installtion soweit durch ist auf dem Rechner nun alles, was man braucht.<br /> - Jetzt muss nur noch die Druckereinstellung angepasst werden, dazu die <code>/etc/cups/cups-pdf.conf</code> Datei öffnen (root)und dort ganz unten <code>#PostProcessing</code> auskommentieren und den Pfad zu einer (unserer) Skript-Datei angeben.<br /> In meinem Beispiel sieht der Eintrag dann so aus:<br /> <code>PostProcessing /usr/local/bin/watermark_script</code><br /> angepasst werden damit die PDFs auch nachbearbeitet werden<br /> - Jetzt nur noch das Script um was Wasserzeich einzufügen (wie im Beispiel dann ausführbar unter /usr/local/bin/watermark_script abzulegen)<br /> <code>#!/bin/bash<br /> FILENAME=`basename1`<br /> DIRNAME=`dirname $1`<br /> /opt/local/bin/pdftk $1 stamp /BACKGROUND.pdf output $DIRNAME"/watermarked_"$FILENAME owner_pw geheimes_Kennwort allow printing compress<br /> rm $1<br /> /sendEmail -f von@domain.com  -t an@domain.com -u $FILENAME -s mein.smtp.server.com -a $DIRNAME"/watermarked_"$FILENAME</code><br /> Nun, soviel sei dazu gesagt:In diesem Skript fügt pdftk eine PDF-Dokumten namens BACKGROUND.pdf zu dem gerade gedruckten PDF hinzu. Dieses PDF liegt direkt unter /.<code>stamp</code></p><div style="width: 45%; float: left; padding-right: 10pt; display: inline; text-align: justify;">bedeutet es überdeckt das PDF, zu dem es hinzugefügt wird (Transparenz =) ).Zudem wird es kompremiert, mit einem Kennwort gegen Änderungen geschützt, darf aber gedruckt werden.Dieses überarbeitet PDF wird dann mit einem Zusatz watermarked_ im gleichen Verzeichnis wie das Ausgangs-PDF abgespeichert (cups-pdf auf dem Schreibtisch, wenn nichts verändert wurde beim PDF-Drucker).dann wird das alte PDF gelöscht und jetzt?Nun, es wird direkt über einen smtp Server per Mail verschickt.So lege ich nämlich meine Briefe ab, ich schicke Sie mir per Mail auf meinen IMAP-Account, so habe ich immer meinen Schrifverkehr online abrufbar.<br /> - das Email-Skript</div><div style="width: 45%; float: left; padding-right: 10pt; display: inline; text-align: justify;">zum versenden von Emails in der Shell habe ich von <a href="http://caspian.dotconf.net/menu/Software/SendEmail/" target="_blank">hier</a><br /> Dabei handelt es sich um ein Perl-Script, dem man recht einfach ein paar Parameter mitgeben kann und schon verschickt es über den angegeben smpt-Server eine Email mit AnhangWenn man sentmail oder ähnliches vielleicht schon eingerichtet hat, funktioniert das versenden der Email natürlich auch via <a href="http://www.hmug.org/man/1/mail.php" target="_blank"><code>mail</code></a><br /> Fertig, jetzt werden alles PDF-Ausdrucke mit meinem Logo versehen und in meine Email-Ablage geschickt. War doch ganz einfach :P</div><div style="clear: both;"></div><h2>Updates 15.02.2011</h2><p>Für Snow Leopard gibt es mittlerweile eine <a href="http://www.pdflabs.com/docs/install-pdftk/">fertig kompilierte</a> Version direkt vom &#8220;Hersteller&#8221; von pdftk</p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2007/12/osx-pdf-drucken-mit-wasserzeichen-versehen-und-per-mail-verschicken/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 7/39 queries in 0.253 seconds using disk: basic
Object Caching 240/497 objects using disk: basic

Served from: hubionmac.com @ 2012-02-12 07:05:05 -->
