<?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"
	>

<channel>
	<title>do IT!</title>
	<atom:link href="http://doit.juii.net/feed" rel="self" type="application/rss+xml" />
	<link>http://doit.juii.net</link>
	<description>The doable IT blog.</description>
	<pubDate>Tue, 12 Aug 2008 20:27:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>How to re-encode a MP3 audiobook to fit on a MP3 player?</title>
		<link>http://doit.juii.net/linux/audiobearbeitung/1059</link>
		<comments>http://doit.juii.net/linux/audiobearbeitung/1059#comments</comments>
		<pubDate>Tue, 12 Aug 2008 20:27:17 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Audiobearbeitung]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Kingzon]]></category>

		<category><![CDATA[lame]]></category>

		<category><![CDATA[MP3 player]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1059</guid>
		<description><![CDATA[Say, you have a large MP3 audio book (or song file collection; in this case, the Bible) and want it to fit on a MP3 player, but it does not fit. Then you can re-encode it, using lame on Linux. While a 128kbps MP3 file (normal audio book quality) has approx. 1MiByte/min, a &#8220;lame -V9&#8243; [...]]]></description>
			<content:encoded><![CDATA[<p>Say, you have a large MP3 audio book (or song file collection; in this case, the Bible) and want it to fit on a MP3 player, but it does not fit. Then you can re-encode it, using lame on Linux. While a 128kbps MP3 file (normal audio book quality) has approx. 1MiByte/min, a &#8220;lame -V9&#8243; variable birate maximum compression MP3 has just 0.4MiByte/min. When allplied to spoken language, the loss in quality is only a little.</p>
<p>To convert your audio book (stored in dirs and files below them), use the following:</p>
<pre>for dir in *; do \
  for file in "$dir"/*; do \
    lame -V 9 "$file" "${file/.mp3/_V9.mp3}"; \
  done; \
done;</pre>
<p>Then, to sort out the newly generated files, and rename them to short names, do the following:</p>
<pre>mkdir AudioBookV9;
for dir in AudioBook/*; do \
  mkdir "${dir/AudioBook/AudioBookV9}"; \
  mv $dir/*_V9.mp3 "${dir/AudioBook/AudioBookV9}"; \
done;</pre>
<pre>for file in AudioBookV9/*/*; do \
  mv "$file" "${file/_V9.mp3/.mp3}"; \
done;</pre>
<p>You now have all relevant files in directoy AudioBookV9, and if the size fits (check with &#8220;du -h AudioBookV9&#8243;), you want to transfer that to your MP3 player. So mount your MP3 player as a mass storage device (here, to /media/misc/), and do this:</p>
<pre>for dir in AudioBookV9/*; do \
  sudo mkdir "/media/misc/${dir/AudioBookV9/}"; \
done;
for file in AudioBookV9/*/*; do \
  sudo cp "$file" "/media/misc/${file/AudioBookV9/}"; \
done;</pre>
<p>Here, note that we don&#8217;t simply copy the whole AudioBookV9/* stuff recursively. This will work in most cases, but for the <a href="http://www.kingzon.de/de/pro/Multimedia/MP3/M3ZH.html" onclick="pageTracker._trackPageview('/outgoing/www.kingzon.de/de/pro/Multimedia/MP3/M3ZH.html?referer=');">KINGZON MP3 Player M3ZH</a> it did not. Here, the order in which files are written to the device is important, as &#8220;normal playing mode&#8221; means that the device plays files in this order, not in alphabetical order. Copying whole directories makes the files being written in the order they appear in the directory tables, so you&#8217;ll have all your chapters mixed up on the device. So use the workaround, or you&#8217;ll hear the end of your fascinating novel way too early <img src='http://doit.juii.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/linux/audiobearbeitung/1059/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to change the margins of PDF files while keeping the page size (&#8221;scale the content&#8221;)?</title>
		<link>http://doit.juii.net/programme/acrobat-reader/1054</link>
		<comments>http://doit.juii.net/programme/acrobat-reader/1054#comments</comments>
		<pubDate>Sat, 02 Aug 2008 12:27:30 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Acrobat Reader]]></category>

		<category><![CDATA[DTP]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Adobe Reader]]></category>

		<category><![CDATA[Ghostscript]]></category>

		<category><![CDATA[margin]]></category>

		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1054</guid>
		<description><![CDATA[This is on how to achieve that on Linux. There are multiple alternatives, but none of them proved perfect yet. Let&#8217;s start.
Alternative 1: using pstops
The task can be performed with pstops (whereof psnup is a simplified frontend).

Convert your PDF file to a PS file, by printing to a file in Adobe Reader, or by using [...]]]></description>
			<content:encoded><![CDATA[<p>This is on how to achieve that on Linux. There are multiple alternatives, but none of them proved perfect yet. Let&#8217;s start.</p>
<h2>Alternative 1: using pstops</h2>
<p>The task can be performed with pstops (whereof psnup is a simplified frontend).</p>
<ol>
<li>Convert your PDF file to a PS file, by printing to a file in Adobe Reader, or by using pdf2ps (Ghostscript-based) or pdftops (xpdf-based).</li>
<li>Use pstops to adjust the margins<code>pstops -p a4 "L@.9(1cm,1cm)" in.ps out.ps</code>
<p>On mounting pages: here, the the task is to mount two A4 pages in A5 format on one A4 page, guaranteeing page margins of 3cm at left and right and 2cm at top and bottom. We need a width of 150mm and a height of 257mm. To scale 297mm (A4 height) to 150mm, use factor 0.505. Such n-up mounting together with freestyle adjustment of margins is not possible ith psnup, which has a simpler user interface.</p>
<p><code>pstops -p a4 "2:0L@.505(18cm,2cm)+1L@.505(18cm,14.85cm)" in.ps out.ps</code></li>
<li>Convert the PS file back to PDF by using pdftops.</li>
</ol>
<p>The problem with psnup (from PSUtils Release 1 Patchlevel 17) and also of its frontend psnup is that it converts fonts to bitmap fonts (Adobe Type 3). This can be detected as rastered fonts when viewing the PDF file with Adobe Reader. It generates somewhat lower print quality, but is still acceptable. What is not acceptable (with respect to file size) is that pstops converts the whole file to an image if it has no idea how to treat it.</p>
<p>To debug pstops and psnup output, you can use the -b option, which will mark out the original pages&#8217; borders.</p>
<h2>Alternative 2: Using Adobe Reader and printer margins</h2>
<p>This has not yet been worked out, but might be possible. When printing (to a file or otherwise) Adobe Reader will fit the pages into the printable area of the selected printer. Now the idea would be to choose the special printer &#8220;Custom &#8230;&#8221;. This allows you to enter a lp print command. Per the <a href="http://www.cups.org/documentation.php/man-lp.html" onclick="pageTracker._trackPageview('/outgoing/www.cups.org/documentation.php/man-lp.html?referer=');">lp documentation</a>, CUPS lp understands options to set the margins. For 2cm at top and bottom and 3cm at left and right, use this command:</p>
<p><code>/usr/bin/lp -o page-top=57 -o page-bottom=57 -o page-left=85 -o page-right=85</code></p>
<p>However, this currently does not work our, for an unknown reason. It does not change anything, i.e. the document is printed as if you selected &#8220;Page scaling: none&#8221; instead of &#8220;Page scaling: fit to printable area&#8221;. If this command is not possible, another alternative would be to set up a printer definition with exactly the margins you desire, in a way that lets you change these margins easily.</p>
<p>If you just need &#8220;larger&#8221; margins around your page (without exact measures), you can do the following:</p>
<ol>
<li>Print the file with Adobe Reader to a PS file. Use the option &#8220;Page scaling: fit o printable area&#8221;. Try several different printers including the &#8220;Custom &#8230;&#8221; special printer to find one that adds margins of the same size all around the page. This step will generate a PS file with larger margins than the original PDF file had, even though this is not correctly shown in the preview of Adobe Reader 8.1.1.</li>
<li>Convert the file to a PDF file by using ps2pdf.</li>
<li>Repeat from step 1 with your new PDF file until the margins are large enough for you.</li>
</ol>
<p>This method has the obvious disadvantage of not allowing to specify the margins exactly, but at least the file retains vector fonts and graphics (unlike whenusing pstops, see above).</p>
<p>If you need the margin adjustents in combination with Adobe Readers n-up printing (e.g. 2 pages per sheet), and if you can adjust the margins in your source file (before generating the initial PDF), you can do the following: adust the margins in the original file so that, after the n-up scaling, these margins together with the selected printer&#8217;s margins, result in the margins you desire. When printing one two pages A4 on one sheet A4 with the special prnter &#8220;Custom &#8230;&#8221; in Adobe Reader 8.1.1, the following margins are used (measured in the output A4 page):</p>
<ul>
<li>left 5,25mm</li>
<li>right 13,71mm</li>
<li>top 6,59mm</li>
<li>bottom 6,59mm (probably)</li>
</ul>
<h2>Alternative 3: Using Adobe Reader and printing the &#8220;current view&#8221;</h2>
<p>Another alternative:</p>
<ol>
<li>Use Adobe Reader to print your page to a large sheet without scaling.</li>
<li>Use ps2pdf to re-destill the PS file to PDF.</li>
<li>Open the new PDF file in Adobe Reader and choose an appropriate view. Use the &#8220;print current view&#8221; option in Adobe Reader to print exactly thet view.</li>
<li>Re-destill the PS output to PDF.</li>
<li>That way, you can even achieve n-up mounting: say you generated to pages, each with content in different places and the rest white space. You can overlay these pages on top of each other using pdftk with the background option.</li>
</ol>
<h2>Alternative 4: Using ghostscript</h2>
<p>The following would constitute an elegant solution: freely adjustable margins <span style="font-style: italic;">and</span> vector fonts and images, and avoiding the GUI hassles. Sad enough, it does not work yet. The idea come from this <a href="http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.postscript/2007-12/msg00035.html" onclick="pageTracker._trackPageview('/outgoing/newsgroups.derkeiler.com/Archive/Comp/comp.lang.postscript/2007-12/msg00035.html?referer=');">thread</a>.</p>
<pre>gs \</pre>
<pre>  -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER \
  -dCompatibilityLevel="1.3" -dPDFSETTINGS="/printer" \
  -dSubsetFonts=true -dEmbedAllFonts=true \
  -sPAPERSIZE=a4 -sOutputFile="out.pdf" \
  -c "&lt;&lt;/BeginPage{0.5 0.5 scale -90 rotate -2384 0 translate}&gt;&gt; setpagedevice" \
  -f in.pdf</pre>
<p>The instruction works, apart from the important -c option part, which adds a postscript command. This instruction would also work with PDF files.</p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/programme/acrobat-reader/1054/feed</wfw:commentRss>
		</item>
		<item>
		<title>Wie kann ich »STEP-FOUR Frässoftware V4 PRO Rev.8« auf einer virtuellen Maschine installieren und verwenden?</title>
		<link>http://doit.juii.net/betriebssysteme-ausser-linux/windows/997</link>
		<comments>http://doit.juii.net/betriebssysteme-ausser-linux/windows/997#comments</comments>
		<pubDate>Fri, 01 Aug 2008 13:59:00 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[CNC-Bearbeitung]]></category>

		<category><![CDATA[Sprache: Deutsch]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[CNC]]></category>

		<category><![CDATA[CoolCNC]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[StepFOUR]]></category>

		<category><![CDATA[Vmware]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=997</guid>
		<description><![CDATA[Das Betriebssystem der virtuellen Maschine muss DOS-kompatibel sein. Hier wird FreeDOS verwendet. Das Host-Betriebssystem ist Linux. Als virtuelle Maschine wird DOSEMU verwendet. Jemand der die Nachfolgesoftware XpertMill unter VMware installiert hat kommentiert: »Auch in einer virtuellen PC Maschine (XpertMill in VMware 5) läufts problemlos [...], da natürlich nur zum Zeichnen/Einrichten im Büro und nicht zum [...]]]></description>
			<content:encoded><![CDATA[<p>Das Betriebssystem der virtuellen Maschine muss DOS-kompatibel sein. Hier wird FreeDOS verwendet. Das Host-Betriebssystem ist Linux. Als virtuelle Maschine wird DOSEMU verwendet. Jemand der die Nachfolgesoftware XpertMill unter VMware installiert hat kommentiert: »Auch in einer virtuellen PC Maschine (XpertMill in VMware 5) läufts problemlos [...], da natürlich nur zum Zeichnen/Einrichten im Büro und nicht zum Fräsen (USB Dongle funktioniert in VMware) .« (von <a href="http://www.yesyes.rc1.at/step4/forum/topic.php?id=6&amp;highlight=&amp;s=f1f1ece6104864a3cfc792361903aef9" title="http://www.yesyes.rc1.at/step4/forum/topic.php?id=6&amp;highlight=&amp;s=f1f1ece6104864a3cfc792361903aef9" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.yesyes.rc1.at/step4/forum/topic.php?id=6_amp_highlight=_amp_s=f1f1ece6104864a3cfc792361903aef9&amp;referer=');">www.yesyes.rc1.at/step4/forum/topic.php?id=6&amp;highlight=&amp;s=f1f1ece6104864a3cfc792361903aef9</a> ).</p>
<p>Ziel ist hier jedoch, mit der DOS-Software »STEP-FOUR Frässoftware V4 PRO Rev.8« auch zu Fräsen. Das scheint prinzipiell möglich trotz dass STEP-FOUR angibt, zum Betrieb der Fräse (ohne XpertMill Controller) sei ein Multitasking-Betriebssystem unbrauchbar. Denn: im Handbuch »CoolCNC Linux First Steps« ( <a href="http://www.thecooltool.com/files/coolcnc-lin-engl-16-04-07.pdf" title="http://www.thecooltool.com/files/coolcnc-lin-engl-16-04-07.pdf" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.thecooltool.com/files/coolcnc-lin-engl-16-04-07.pdf?referer=');">www.thecooltool.com/files/coolcnc-lin-engl-16-04-07.pdf</a> ) steht: »At low clock frequencies, control of stepper motors is not possible or only at slow traversing rates.« (S.2). Somit ist es also unter Linux als Multitasking-Betriebssystem doch möglich, die STEP-FOUR Fräsen mit Motor-Controller SF-C2 zu betreiben. Der Prozessor muss natürlich schnell genug sein, nach Angaben des Handbuchs ab 500 MHz (S.1). Die Lösung in CoolCNC basiert auf Echtzeiterweiterungen des Linux-Kerns (RTAI-Linux) (nach <a href="http://www.thecooltool.com/files/dateien_506.pdf" title="http://www.thecooltool.com/files/dateien_506.pdf" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.thecooltool.com/files/dateien_506.pdf?referer=');">www.thecooltool.com/files/dateien_506.pdf</a> , S.2).</p>
<p>Allerdings: Im EMC2-Projekt wird davor gewarnt, Software die für Echtzeit-Betrieb gedacht ist in Emulatoren und virtuellen Maschinen einzusetzen: »EMC runs in real-time, to give smooth motion. This is critical to accuracy and machine life. [...] The above also apply to virtual machines (i.e. VMWARE) and emulators. It may be possible to trick EMC to run on a virtual machine but do so at your own risk!« ( <a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl/" title="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/wiki.linuxcnc.org/cgi-bin/emcinfo.pl/?referer=');">wiki.linuxcnc.org/cgi-bin/emcinfo.pl/</a> ).</p>
<ol>
<li>Man installiere aus den Ubuntu-Archiven: dosemu, dosemu-freedos, xfonts-dosemu.</li>
<li>Man startet DOSEMU mit FreeDOS durch den Befehl »dosemu« in einem Terminal.</li>
<li>Das Linux-Home-Verzeichnis ist nun verfügbar unter D:. Man extrahiert die Installations-CD der »STEP-FOUR Frässoftware V4 PRO Rev.8« (oder einer früheren Version) in ein Verzeichnis unterhalb des Linux-Home-Verzeichnisses und wechselt in DOSEMU in das neu entstandene Unterverzeichnis »DOS/«. Dann in DOSEMU eingeben: »INSTALL.EXE«. Achtung: das Verzeichnis »Setup« der Installations-CD enthält die »STEP-FOUR Frässoftware V4 PRO« für Windows.</li>
<li>Als Zielverzeichnis der Installation kann man ein Verzeichnis unterhalb des Linux-Home-Verzeichnisses angeben, z.B. »D:\DESKTOP\S4V4PRO«.</li>
<li>Man startet das Programm mit »S4PRO.EXE«. Es meldet: »Die STEP-FOUR Elektronikbox konnte nicht gefunden werden! Überprüfen Sie die Verbindnung oder schalten Sie die Box ein. Weiter mit beliebiger Taste.«. Offensichtlich wird die Elektronikbox als eine Art »Dongle« verwendet. Mit »Elektronikbox« ist der Motor-Controller SF-C2 gemeint, der über einen 25-poligen Sub-D-Stecker (»Druckerkabel«) an den Computer angeschlossen wird. Im Benutzerhandbuch<br />
»Frässoftware V4.x Software Manual Revision 1.1« steht: »Stellen Sie sicher dass das STEP-FOUR Steuergerät oder der Dongle für Fremdanlagen/Zweit-PC mit dem Computer verbunden ist.«</li>
</ol>
<p>Hier wurde dieser Versuch abgebrochen: statt ein Dongle zu kaufen oder ein andere Lösung für dieses Problem zu finden scheint es vielversprechender, »CoolCNC Linux« auszuprobieren.</p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/betriebssysteme-ausser-linux/windows/997/feed</wfw:commentRss>
		</item>
		<item>
		<title>How can I do arbitrary vector-oriented modifications to a PDF file on Linux, though all the editors are still buggy?</title>
		<link>http://doit.juii.net/linux/graphikbearbeitung/1055</link>
		<comments>http://doit.juii.net/linux/graphikbearbeitung/1055#comments</comments>
		<pubDate>Fri, 01 Aug 2008 12:41:39 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[DTP]]></category>

		<category><![CDATA[Graphikbearbeitung]]></category>

		<category><![CDATA[OpenOffice]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[OOo Draw]]></category>

		<category><![CDATA[OpenOffice.org]]></category>

		<category><![CDATA[OpenOffice.org Draw]]></category>

		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1055</guid>
		<description><![CDATA[If you have a PDF which you want to modify (and can&#8217;t get hold of the source format file), you might have tried scribus to open and change it. This works well for some simple cases, but there are many import errors for more complex files. Also, the same might happen with Inkscape if you [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a PDF which you want to modify (and can&#8217;t get hold of the source format file), you might have tried scribus to open and change it. This works well for some simple cases, but there are many import errors for more complex files. Also, the same might happen with Inkscape if you have managed to convert the file to SVG format, e.g. using CorelDraw on a Windows virtual machine.</p>
<p>What&#8217;s always possible is to import the file in GIMP (&#8221;File -&gt; Open&#8221;), using a high resolution such as 300dpi. But you might want to avoid the big file sizes and loss in quality, and want to do it vector-oriented.</p>
<p>Therefore, the following solution should work out:</p>
<ol>
<li>Convert a low resolution raster image version of the PDF file, e.g. by opening in GIMP (with 150dpi) and saving in JPG format.</li>
<li>Create a <a href="http://OpenOffice.org" title="http://OpenOffice.org" target="_blank" onclick="pageTracker._trackPageview('/outgoing/OpenOffice.org?referer=');">OpenOffice.org</a> Draw drawing with the same page size as your PDF file, and place the raster image file into the background.</li>
<li>Now that you have the placement of things, change the appearance by adding other elements on top your background. You might want to get some vector oriented elements out of the PDF file by importing the file in scribus and saving as SVG or EPS file, importing that in OOo Draw.</li>
<li>Export the OOo file to PDF, temporarily removing your background for that. The good thing is that all OOo Draw elements get high-quality vecor oriented PDF elements.</li>
<li>Add your new PDF file on top of the original one, by saying something like:<br />
pdftk in.pdf stamp overlay.pdf output out.pdf;</li>
</ol>
<p>As the original vector elements are never converted from PDF to another format and back, no import / export bugs can come in the way!</p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/linux/graphikbearbeitung/1055/feed</wfw:commentRss>
		</item>
		<item>
		<title>How can I combine two PDF files so that they are &#8220;overlayed&#8221; one to the other?</title>
		<link>http://doit.juii.net/programme/acrobat-reader/1050</link>
		<comments>http://doit.juii.net/programme/acrobat-reader/1050#comments</comments>
		<pubDate>Mon, 21 Jul 2008 22:29:49 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Acrobat Reader]]></category>

		<category><![CDATA[DTP]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[overlay]]></category>

		<category><![CDATA[PDF]]></category>

		<category><![CDATA[pdftk]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1050</guid>
		<description><![CDATA[This might become necessary if you want to add content to an already existing PDF file, e.g. when doing pre-press work for flyers etc.. For example, you might resize one PDF file to have additional place on the page, and put other content into that free space.
Get yourself two PDF files to overlay on each [...]]]></description>
			<content:encoded><![CDATA[<p>This might become necessary if you want to add content to an already existing PDF file, e.g. when doing pre-press work for flyers etc.. For example, you might resize one PDF file to have additional place on the page, and put other content into that free space.</p>
<p>Get yourself two PDF files to overlay on each other, both of the same page size (else automatic resizing is employed), and both one-sided.</p>
<p>Then use this command to generate the combined PDF file with overlays:</p>
<pre>pdftk file1.pdf background file2.pdf output out.pdf</pre>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/programme/acrobat-reader/1050/feed</wfw:commentRss>
		</item>
		<item>
		<title>How can I place a PDF file on a bigger, custom-sized page, with free choice of placement?</title>
		<link>http://doit.juii.net/programme/acrobat-reader/1049</link>
		<comments>http://doit.juii.net/programme/acrobat-reader/1049#comments</comments>
		<pubDate>Mon, 21 Jul 2008 22:04:28 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Acrobat Reader]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[PDF]]></category>

		<category><![CDATA[xpdf]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1049</guid>
		<description><![CDATA[You might open the PDF file in Adobe Reader and print it there to a Postscript file (setting page size to &#8220;Custom&#8230;&#8221; and choosing a bigger than current), but this does not allow free placement, instead Adobe Reader always centers the output on the paper.
Instead, use xpdf. Start it and set the desired print page [...]]]></description>
			<content:encoded><![CDATA[<p>You might open the PDF file in Adobe Reader and print it there to a Postscript file (setting page size to &#8220;Custom&#8230;&#8221; and choosing a bigger than current), but this does not allow free placement, instead Adobe Reader always centers the output on the paper.</p>
<p>Instead, use xpdf. Start it and set the desired print page output size simulteneously:</p>
<pre>xpdf -paperw 3444 -paperh 4252 -z page infile.pdf</pre>
<p>xpdf expects the sized in <a href="http://en.wikipedia.org/wiki/Point_(typography)" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Point_typography?referer=');">Postscript points</a>: 1 point = <span class="template-frac" style="white-space: nowrap;"><sup>127</sup><big>⁄</big><sub>360</sub></span> mm = 352.<span style="text-decoration: overline;">7</span> µm. Sad enough, xpdf also centers the output on the page.</p>
<p>But we have another trick: calculate a page size where you can cut out your desired page size after the content gets centered on it. Generate a PDF with that size using either xpdf or Adobe Reader, printing to file with them and re-destilling to a PDF file. Then, open it in Adobe Reader and bring place the view (i.e. what you see on your screen) exactly so that it covers the page size you want the document to have. You need to set the zoom level for that (which is also possible in 0.01% steps!).</p>
<p>Then print in Adobe Reader to a Postscript file and select &#8220;current view&#8221;. Adobe Reader informs you about the size of the view in the print preview, so that you can adjust your settings.</p>
<p>And to conclude, destill the Postscript file again to PDF using ps2pdf.</p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/programme/acrobat-reader/1049/feed</wfw:commentRss>
		</item>
		<item>
		<title>How can I print a StampIt! stamp directly in my document though my word processor does not integrate with StampIt?</title>
		<link>http://doit.juii.net/meta/englisch/1048</link>
		<comments>http://doit.juii.net/meta/englisch/1048#comments</comments>
		<pubDate>Sat, 12 Jul 2008 14:58:29 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[StampIt]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[OpenOffice.org]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1048</guid>
		<description><![CDATA[This problem arises e.g. when you use StampIt! in a Windows virtual machine with Linux, because Linux is not supported natively yet. Then you might want to print the stamp in OpenOffice.org (or whatever) documents, but how?
Solution:

In your Windows virtual machine, create a PDF pseudo printer (PrimoPDF or other, there are some free to download).
Print [...]]]></description>
			<content:encoded><![CDATA[<p>This problem arises e.g. when you use StampIt! in a Windows virtual machine with Linux, because Linux is not supported natively yet. Then you might want to print the stamp in <a href="http://OpenOffice.org" title="http://OpenOffice.org" target="_blank" onclick="pageTracker._trackPageview('/outgoing/OpenOffice.org?referer=');">OpenOffice.org</a> (or whatever) documents, but how?</p>
<p>Solution:</p>
<ol>
<li>In your Windows virtual machine, create a PDF pseudo printer (PrimoPDF or other, there are some free to download).</li>
<li>Print from StampIt to your PDF pseudo printer. Normally, a window will appear that asks you where to save your file. You may save it directly in a directory that you can access from your Linux host OS (e.g. a VirtualBox shared directory, if you use VirtuslBox as your VM).</li>
<li>Open the PDF file in Linux with GIMP (import with at least 300dpi).</li>
<li>Use the &#8220;auto crop image&#8221; feature of GIMP.</li>
<li>Use the &#8220;brightness &amp; contrast&#8221; feature of GIMP, choose maximum contrast and minimum brightness. This prepares your image for black&amp;white, because greyscale printing will destroy the 2D barcode here.</li>
<li>Use the &#8220;image: mode: one bit palette&#8221; feature in GIMP.</li>
<li>Save as a PNG image. Steps 3-6 can also be performed by an automated script using ImageMagick.</li>
<li>Insert the image in your OOo document, choosing &#8220;anchor to page&#8221; and &#8220;run-through&#8221;, placing it simply to hide the normal address (which stays intact this way).</li>
<li>Print your document out.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/meta/englisch/1048/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to solve a &#8220;java.lang.LinkageError: &#60;some class&#62;&#8221; between two JAR files?</title>
		<link>http://doit.juii.net/softwareentwicklung/java/1046</link>
		<comments>http://doit.juii.net/softwareentwicklung/java/1046#comments</comments>
		<pubDate>Tue, 17 Jun 2008 22:30:35 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[build path]]></category>

		<category><![CDATA[linkage error]]></category>

		<category><![CDATA[PDE]]></category>

		<category><![CDATA[plugin classpath]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1046</guid>
		<description><![CDATA[A java.lang.LinkageError happens when &#8220;a class has   some dependency on another class; however, the latter class has   incompatibly changed after the compilation of the former class.&#8221; [Java Platform SE 6 API Docs on LinkageError]. Normally, the error is more concretely defined by subclasses of LinkageError, but not always. There are multiple [...]]]></description>
			<content:encoded><![CDATA[<p>A java.lang.LinkageError happens when &#8220;a class has   some dependency on another class; however, the latter class has   incompatibly changed after the compilation of the former class.&#8221; [<a onclick="pageTracker._trackPageview('/outgoing/java.sun.com/javase/6/docs/api/java/lang/LinkageError.html?referer=');pageTracker._trackPageview('/outgoing/java.sun.com/javase/6/docs/api/java/lang/LinkageError.html?referer=http://doit.juii.net/wp-admin/post.php?action=edit&amp;post=1046');" href="http://java.sun.com/javase/6/docs/api/java/lang/LinkageError.html">Java Platform SE 6 API Docs on LinkageError</a>]. Normally, the error is more concretely defined by subclasses of LinkageError, but not always. There are multiple reasons possible:</p>
<ol>
<li><strong>You have a JAR file in your project that requires another JAR file that&#8217;s not in your project.</strong> In this case, the latter JAR file is installed somewhere on your system. It is found, but it&#8217;s version differs from the version where the JAR file in your project was compiled against. So to speak, the JAR file &#8220;changed (in version) after the compilation of the JAR file that&#8217;s in your project&#8221;.<br />
A solution (sometimes possible) is to include the requiring JAR as source code into your project. Then, it is comiled itself, and correctly linked against the available version of the required JAR file.<br />
The alternative, obvious solution is to let the JAR find its expected version of the required JAR files. You may influence this by the order of entries in the Java build path, or if you do Eclipse plugin development and you want JAR files within your plugin to be found, in the plugin classpath in MANIFEST.MF.</li>
<li><strong>You run into an error of Eclipse 3.3.1.1.</strong> You recognize this if the java.lang.linkage error persists even if both the requiring and the required JAR files are replaced by source versions in the Eclipse project. (This bug possibly applies only to Eclipse plugin projects.) If this is the case, the required library is one that&#8217;s also part of the Java system library. It seems that the Eclipse framework uses its own class loader and replaces the Java class loader, or something with similar effect. The effect is that at runtime, the code refers to other code (always the library that&#8217;s part of the Java system library) than at compile time (the library within the same or another plugin project). So again, the required JAR file &#8220;changed&#8221; (in version) from compile time to runtime.<br />
Solution: include the requiring JAR as source code, and remove all duplicates of the library from your projects, so that the only installed version of the required JAR library is in the Java system library. Now both at compile and runtime, this is the only thing where requiring code can refer to.</li>
</ol>
<p>A concrete example for the Eclipse bug described above: the error message was &#8220;java.lang.LinkageError: org/xml/sax/ContentHandler&#8221; in a plugin used to capsule JDOM code (as source, not as a JAR file).</p>
<p>Due to the bug, at runtime JDOM code always used the Java system library&#8217;s SAX when doing &#8220;import org.xml.sax.ContentHandler&#8221;. Regardless of what the code referred to at compile time: SAX in a JAR file in the same or a required plugin project, SAX as source code in the same source folder of the same plugin project etc..</p>
<p>Also, using the &#8220;order&#8221; feature when configuring the Java build path of the JDOM plugin project did not help: &#8220;plugin dependencies&#8221; can be placed above &#8220;Java system library&#8221;, but regardless of that setting, at runtime the Java system library was used. And this was a JAR file with a different version than what the project was compiled against at compile time &#8230; .</p>
<p>The solution was this: remove the dependency from another plugin that contained SAX as a JAR library, and (!) remove the SAX source and JAR files from the plugin project that encapsuled JDOM. Only one of these steps is not enough. Both together probably made Eclipse compile against the same lib as used at runtime, namely SAX form the Java system library.</p>
<p>To conclude: currently, there seems to be no possibility to use a package in place of a package of the same name that&#8217;s supplied by the Java system library; which is an Eclipse bug.</p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/softwareentwicklung/java/1046/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to fix a &#8220;NoClassDefFoundError: [some class]&#8221; error when developing Eclipse plugins?</title>
		<link>http://doit.juii.net/meta/englisch/1045</link>
		<comments>http://doit.juii.net/meta/englisch/1045#comments</comments>
		<pubDate>Tue, 17 Jun 2008 22:08:01 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[NoClassDefFoundError]]></category>

		<category><![CDATA[PDE]]></category>

		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1045</guid>
		<description><![CDATA[Here&#8217;s one solution to one cause, there might be other causes as well. The error means that the class definition existed when compiling but disappeared in the meantime (see Sun Documentation). You see this from the fact that this error message is thrown e.g. when deleting a necessary .class file in the bin output folder [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one solution to one cause, there might be other causes as well. The error means that the class definition existed when compiling but disappeared in the meantime (see <a onclick="pageTracker._trackPageview('/outgoing/java.sun.com/javase/6/docs/api/java/lang/NoClassDefFoundError.html?referer=');pageTracker._trackPageview('/outgoing/java.sun.com/javase/6/docs/api/java/lang/NoClassDefFoundError.html?referer=http://doit.juii.net/wp-admin/post-new.php?posted=1045');" href="http://java.sun.com/javase/6/docs/api/java/lang/NoClassDefFoundError.html">Sun Documentation</a>). You see this from the fact that this error message is thrown e.g. when deleting a necessary .class file in the bin output folder of a project. (However, deleting a .class file may also result in java.lang.ClassNotFoundException, for classes that are dynamically loaded by some configurable class loader utility.</p>
<p>In this case, a plugin needed a library (JDOM), which was capsuled in another plugin. Note that these errors are hard to trace with a debugger: the line that generates the exception may need one type of the required library in the other plugin, and that type might be a subtype of the one that&#8217;s in the error message, or similar complicated things. With the debugger, you cannot &#8220;step into&#8221; the loading of statically bound .class files (that&#8217;s behind the scenes), and therefore just see this error message appearin out of nothing. You can, however, &#8220;step into&#8221; the loading of dynamically loaded classes, where some configurable class loader utility is involved.</p>
<p>First, here&#8217;s the list of things that did not help:</p>
<ol>
<li>It was no problem of a missing .class file, as the required .class file was in place.</li>
<li>Cleaning and rebuilding the at.ezra.thirdparty.jsword project (equivalent to deleting bin/*) changes nothing regarding these errors. So it&#8217;s not just due to a missing or erroneous .class file.</li>
<li>&#8220;PDE-Tools -&gt; Update classpath&#8230;&#8221; for all or some plugins does not cure the errors.</li>
<li>It might be necessary to include a plugin dependency to the plugin that  contains the library, even if Eclipse doesn&#8217;t demand this. Eclipse might not notice that this dependency is necessary if the library is just necessary in dynamically loaded classes, involving some configurable class loader utility. However, this did not solve the issue here.</li>
<li>It was no problem of lacking dependencies etc. between the two plugins, as the error even arouse when placing the library .jar file directly into the plugin that needed it.</li>
</ol>
<p>And now, the thing that did the cure:</p>
<ol>
<li>Open MANIFEST.MF of the plugin that contains your not-found class definition (here the library plugin). Use the Eclipse manifest editor for this.</li>
<li>Go to tab &#8220;Runtime&#8221;, section &#8220;Classpath&#8221;, click &#8220;New&#8221; and enter &#8220;.&#8221; in the edit box. That&#8217;s it. In this tab, it&#8217;s written that the plugin root dir is automatically (!) the plugin&#8217;s class path, but they mean, only if there are no additional entries, in which case one must enter &#8220;.&#8221; additionally. You need additional entries if you plugin&#8217;s library file is located outside of the plugin root dir, e.g. in &#8220;lib/&#8221;.</li>
</ol>
<p>The result is a new line &#8220;.&#8221; (last line in code below!) in the build.properties file, meaning that the plugin&#8217;s root dir is now included into the plugin&#8217;s classpath. Only then, the .class files in the bin directory can be found, as the bin directory is placed below the plugins root dir. (This whole thing might be an Eclipse bug, actually &#8230;).</p>
<p><code>bin.includes = META-INF/,\<br />
lib/jaxen-core.jar,\<br />
lib/jaxen-jdom.jar,\<br />
lib/saxpath.jar,\<br />
.</code></p>
<p>Additionally, the following steps might be necessary: add the following lines in the plugin&#8217;s build. properties file (they might be missing, but at least the src.. and bin.. lines should be present in all plugins):</p>
<p><code>jars.compile.order = .<br />
source.. = src/<br />
output.. = bin/</code></p>
<p>A tip: the general process of removing path-related / class search related errors is probably this: compare build.properties, .classpath and MANIFEST.MF with working species of these files from other plugins.</p>
<p>And if you get a &#8220;java.lang.LinkageError: &lt;some class&gt;&#8221; error, this might be just a synonym of this error, so check this first.</p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/meta/englisch/1045/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to correct wrong / missing SVN annotation icons in Subclipse 1.2.4?</title>
		<link>http://doit.juii.net/softwareentwicklung/java/1044</link>
		<comments>http://doit.juii.net/softwareentwicklung/java/1044#comments</comments>
		<pubDate>Mon, 16 Jun 2008 22:27:34 +0000</pubDate>
		<dc:creator>matthias</dc:creator>
		
		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Sprache: Englisch]]></category>

		<category><![CDATA[alle Artikel]]></category>

		<category><![CDATA[Eclipse annotation icon]]></category>

		<category><![CDATA[Subclipse]]></category>

		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://doit.juii.net/?p=1044</guid>
		<description><![CDATA[Annotation icons are the small icons placed on top of other icons, mainly in the package explorer view of Eclipse. In Subclipse 1.2.4, it can happen that these are no longer shown (or incorrectly shown), though the project is in SVN.
To correct missing icons, restart Eclipse or switch the workspace forth and back.
To correct wrong [...]]]></description>
			<content:encoded><![CDATA[<p>Annotation icons are the small icons placed on top of other icons, mainly in the package explorer view of Eclipse. In Subclipse 1.2.4, it can happen that these are no longer shown (or incorrectly shown), though the project is in SVN.</p>
<p>To correct missing icons, restart Eclipse or switch the workspace forth and back.</p>
<p>To correct wrong icons (like »?« where »in sync« should be), disconnect the project from SVN without deleting the SVN metadata, then reconnect.</p>
]]></content:encoded>
			<wfw:commentRss>http://doit.juii.net/softwareentwicklung/java/1044/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
