<?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>infotexture &#187; DITA</title>
	<atom:link href="http://infotexture.net/tag/dita/feed/" rel="self" type="application/rss+xml" />
	<link>http://infotexture.net</link>
	<description>Information Architecture &#38; Content Strategy</description>
	<lastBuildDate>Sat, 03 Sep 2011 14:59:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>DITA-OT: Scaling Images in PDF Output</title>
		<link>http://infotexture.net/2010/03/dita-ot-scaling-images-in-pdf-output/</link>
		<comments>http://infotexture.net/2010/03/dita-ot-scaling-images-in-pdf-output/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 19:02:32 +0000</pubDate>
		<dc:creator>roger</dc:creator>
				<category><![CDATA[DITA]]></category>
		<category><![CDATA[DITA-OT]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://infotexture.net/?p=340</guid>
		<description><![CDATA[When generating PDF output via the DITA Open Toolkit, users often stumble over image scaling issues. While smaller graphics are typically rendered without problems, large images may extend beyond the page dimensions, throw errors in the log file or not appear at all. So we need a way to downscale larger images. There are basically [...]]]></description>
			<content:encoded><![CDATA[<p>When generating PDF output via the <a href="http://sourceforge.net/projects/dita-ot/">DITA Open Toolkit</a>, users often stumble over image scaling issues. While smaller graphics are typically rendered without problems, large images may extend beyond the page dimensions, throw errors in the log file or not appear at all. So we need a way to downscale larger images. </p>

<p><strong>There are basically two options:</strong> either add image dimensions to the DITA source files, or adjust the resolution of the images themselves. The latter can be done by hand, via batch processing, or with a system-wide service.</p>

<h2>Specifying Dimension Attributes in DITA Markup</h2>

<p>Recent toolkit versions <em>(as of 1.4.3)</em> honor the dimension-related attributes in the <code>&lt;image&gt;</code> element, so specifying the height or width of the image is often enough: 
<code>&lt;image href="../path/to/file.png" placement="break" width="15cm"/&gt;</code>.</p>

<p>This first method affects both HTML and PDF output. However, if you&#8217;re using an older toolkit version, if modifying your DITA source files isn&#8217;t an option, or if you only want to change the scale in PDFs <em>(but not in HTML)</em>, you may be better off changing the metadata of the image files instead.</p>

<h2>Adjusting Image Resolution</h2>

<p>If you’re using RenderX <a href="http://www.renderx.com/tools/xep.html">XEP</a> to produce PDFs, setting the image resolution to 120 dpi will often do the trick. The <em>XEP User Guide</em> includes this useful bit of wisdom:</p>

<blockquote>
  <p>Bitmap graphic[s] that have no built-in resolution or 
  dimension data, default to a resolution of 120 dpi (5 dots of a
  600-dpi printer) as prescribed by the CSS2 Spec. </p>
</blockquote>

<p>So that’s what we need to know: <strong>XEP assumes a resolution of 120 dpi</strong>. </p>

<p>As the <em>User Guide</em> explains:</p>

<blockquote>
  <p>This is always the case for GIF images, but may also occur with other image types. The XSL Recommendation suggests using 0.28 mm as a pixel size in such cases, which corresponds to 90 dpi resolution. A smaller pixel size gives better print results because the proportion between pixel size and page width is similar to that of a computer screen. With lower resolutions, often the large GIF/JPEG images fit onto a screen but not into the printable area on the page.</p>
</blockquote>

<p>You can use your favorite pixel graphics program to change the image resolution to 120 dpi. You don&#8217;t want to resample the image, only change the dpi setting (or <em>“pixel density”</em>) in the image metadata.</p>

<p>This is easy to do by hand for a single image, but it quickly gets tedious for large numbers of files.</p>

<h2>Processing with ImageMagick</h2>

<p>As the name suggests, the <a href="http://www.imagemagick.org/">ImageMagick</a> software suite provides a powerful arsenal of tools and wizardry that can be used to perform any number of tricks on individual images, or entire directories.</p>

<p>If you&#8217;re running Mac OS X, you can use <a href="http://www.macports.org/install.php">MacPorts</a> to install ImageMagick:</p>

<pre><code>sudo port install ImageMagick  
</code></pre>

<p>The versatile <a href="http://www.imagemagick.org/script/mogrify.php">mogrify</a> command included with ImageMagick can be used to edit images in place, overwriting the original files. The <code>units</code> and <code>density</code> options will do just what we need:</p>

<pre><code>mogrify -units PixelsPerInch -density 120 test.png  
</code></pre>

<p>This sets the pixel density of <code>test.png</code> to 120 dpi. To process all PNG files in a folder, use:</p>

<pre><code>mogrify -units PixelsPerInch -density 120 *.png  
</code></pre>

<p>These commands can be adjusted to process all image types in a folder at once, or chain other effects <em>(such as drop shadows)</em> into a single command.</p>

<h2>Creating a Mac OS X Service with Automator</h2>

<p>If you’re a little leery of the command line and prefer something a bit more user-friendly, you can use Automator to create a system-wide service. Then changing the resolution for a selection of files is as easy as selecting a command from the <strong>Services</strong> menu.</p>

<p>To create the service with Mac OS 10.6 <em>Snow Leopard:</em> </p>

<ol>
<li>Open <code>/Applications/Automator.app</code>, select the <strong>Service</strong> template and click <strong>Choose</strong>.</li>
<li>At the top of the workflow area on the right side of the window, change the first list option to <strong>image files</strong>.</li>
<li>From the <strong>Automator</strong> library, add the <strong>Run Shell Script</strong> action.
Leave the <strong>Shell</strong> set to <code>/bin/bash</code>, set <strong>Pass input</strong> to <code>as arguments</code>, and replace <code>echo</code> in the default script with <code>/opt/local/bin/mogrify -units PixelsPerInch -density 120</code>.</li>
</ol>

<p>When you&#8217;re done, the Automator dialog should look like this:</p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" src="http://infotexture.net/wp-content/uploads/2011/01/ImageMagick-workflow-service.png" alt="ImageMagick workflow service.png" border="0" width="542" height="402" /></p>

<p>Save the workflow as a service, and you can run it on files &amp; folders in the Finder by Control-clicking and choosing your new command from the <strong>Services</strong> submenu in the shortcut menu.</p>

<p>If you&#8217;d rather just download a copy of my service, you&#8217;ll find it <a href="http://downloads.infotexture.net/ImageMagick-workflow-service.zip">here</a>. Unpack the archive and copy the contents to <code>~/Library/Services</code>.</p>

<hr />
]]></content:encoded>
			<wfw:commentRss>http://infotexture.net/2010/03/dita-ot-scaling-images-in-pdf-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDF2: Removing Page Numbers from Cross References and Customizing Cover Pages</title>
		<link>http://infotexture.net/2009/02/pdf2-removing-page-numbers-from-cross-references-and-customizing-cover-pages/</link>
		<comments>http://infotexture.net/2009/02/pdf2-removing-page-numbers-from-cross-references-and-customizing-cover-pages/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 16:47:54 +0000</pubDate>
		<dc:creator>roger</dc:creator>
				<category><![CDATA[DITA]]></category>
		<category><![CDATA[DITA-OT]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.infotexture.net/?p=285</guid>
		<description><![CDATA[Dan Ochs of Wrycan Inc. has posted several nice tutorials on customizing the output produced by the DITA Open Toolkit PDF2 Plugin: one covers removing page numbers from cross references, and another explains how to modify PDF2 cover pages to include a company logo. Nice job Dan!]]></description>
			<content:encoded><![CDATA[<p>Dan Ochs of <a href="http://xsl.wrycan.com/">Wrycan Inc.</a> has posted several nice tutorials on customizing the output produced by the <a href="http://sourceforge.net/projects/dita-ot/">DITA Open Toolkit</a> PDF2 Plugin:</p>

<ul>
<li>one covers <a href="http://wrycan.blogspot.com/2009/02/how-to-customize-dita-open-toolkit-pdf.html">removing page numbers</a> from cross references, and </li>
<li>another explains how to <a href="http://wrycan.blogspot.com/2009/02/how-to-modify-cover-page-in-dita-open.html">modify PDF2 cover pages</a> to include a company logo.</li>
</ul>

<p>Nice job Dan!</p>
]]></content:encoded>
			<wfw:commentRss>http://infotexture.net/2009/02/pdf2-removing-page-numbers-from-cross-references-and-customizing-cover-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DITA-OT 1.5 Milestone 10</title>
		<link>http://infotexture.net/2009/01/dita-ot-15-milestone-10/</link>
		<comments>http://infotexture.net/2009/01/dita-ot-15-milestone-10/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 22:32:23 +0000</pubDate>
		<dc:creator>roger</dc:creator>
				<category><![CDATA[DITA]]></category>
		<category><![CDATA[DITA-OT]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdf2]]></category>

		<guid isPermaLink="false">http://blog.infotexture.net/?p=251</guid>
		<description><![CDATA[Today Robert Anderson announced the availability of Milestone 10 of the DITA Open Toolkit version 1.5. This test build provides insight into development progress toward the next toolkit release, which is scheduled to support the upcoming DITA 1.2 specification. For details, see the wiki page titled &#8220;Plans for DITA Open Toolkit version 1.5.” Among the [...]]]></description>
			<content:encoded><![CDATA[<p>Today Robert Anderson announced the availability of <a href="http://sourceforge.net/project/showfiles.php?group_id=132728&amp;package_id=179008&amp;release_id=655033">Milestone 10</a> of the DITA Open Toolkit version 1.5.</p>

<p>This test build provides insight into development progress toward the next toolkit release, which is scheduled to support the upcoming DITA 1.2 specification. For details, see the wiki page titled &#8220;<a href="http://dita.xml.org/wiki/plans-for-dita-ot-15">Plans for DITA Open Toolkit version 1.5</a>.”</p>

<p>Among the changes in Milestone 10 are a number of updates to the PDF2 plugin. The <code>print=no</code> attribute setting is now honored, and a new basic settings file has been added to the plugin to make <a href="http://blog.infotexture.net/2009/01/15/customizing-pdf2-output/">customization</a> easier. For the full list of changes, see &#8220;<a href="http://dita.xml.org/wiki/plans-for-the-dita-open-toolkit-pdf2-plug-in">Plans for the DITA Open Toolkit PDF2 Plug-in</a>.&#8221; </p>
]]></content:encoded>
			<wfw:commentRss>http://infotexture.net/2009/01/dita-ot-15-milestone-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

