<?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>InDesign SDK</title>
	<atom:link href="http://blogs.adobe.com/indesignsdk/feed" rel="self" type="application/rss+xml" />
	<link>http://blogs.adobe.com/indesignsdk</link>
	<description>InDesign SDK Technical Information</description>
	<lastBuildDate>Fri, 08 Mar 2013 11:52:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>DollyXs command line tool</title>
		<link>http://blogs.adobe.com/indesignsdk/2013/02/dollyxs-command-line-tool.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2013/02/dollyxs-command-line-tool.html#comments</comments>
		<pubDate>Mon, 25 Feb 2013 11:56:07 +0000</pubDate>
		<dc:creator>Aleksandra Szymanczak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Dolly]]></category>
		<category><![CDATA[DollyXs]]></category>
		<category><![CDATA[InDesign Plugin]]></category>
		<category><![CDATA[InDesign SDK]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/?p=148</guid>
		<description><![CDATA[What is DollyXs? Dolly is a Java application for generating new InDesign plug-in projects. It is included with the Plug-in SDK. Dolly has a simple user interface, but it can also be used from the command line. User interface version &#8230; <a href="http://blogs.adobe.com/indesignsdk/2013/02/dollyxs-command-line-tool.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>What is DollyXs?</h2>
<p>Dolly is a Java application for generating new InDesign plug-in projects. It is included with the <a href="http://www.adobe.com/devnet/indesign/sdk.html">Plug-in SDK</a>. Dolly has a simple user interface, but it can also be used from the command line. User interface version of Dolly has a limited amount of settings that you can adjust. Using command line tool opens up a bigger range of options via manipulating the XML document directly. You can create many different input files and use them as templates for your plug-in development. In this blog post, I&#8217;ll show you how to use the command line to generate new InDesign plug-in projects.</p>
<h2>Running Dolly</h2>
<p>First, we&#8217;ll launch Dolly from the command line. Dolly is located inside the plug-in SDK: /devtools/sdktools/dollyxs.<br />
<a href="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-20-at-11.53.18-e1361787406312.png"><img class="alignnone size-full wp-image-150" alt="Screen Shot 2013-02-20 at 11.53.18" src="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-20-at-11.53.18-e1361787406312.png" width="400" height="103" /></a><br />
We&#8217;ll need to open command prompt or terminal and set the current directory to /devtools/sdktools/dollyxs. Let’s first try running Dolly with user interface option turned on.</p>
<p>Windows: <code>DollyXs.bat win-input.xml</code><br />
Mac: <code>DollyXs.sh mac-input.xml</code></p>
<p>You should be able to see the UI for Dolly:<br />
<a href="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-20-at-12.47.14.png"><img class="alignnone size-medium wp-image-151" alt="Screen Shot 2013-02-20 at 12.47.14" src="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-20-at-12.47.14-256x300.png" width="256" height="300" /></a><br />
The input files win-input.xml and mac-input.xml are the default XML documents that Dolly uses to generate projects. They define the properties of your new plug-in, such as whether you&#8217;re creating a model or a UI plug-in or if it is for InDesign or InCopy. It is not necessary to provide these files explicitly when running Dolly with UI.<br />
Now close Dolly and try launching it with user interface disabled. To do that we&#8217;ll use the -q flag.</p>
<p>Windows: <code>DollyXs.bat -q win-input.xml</code><br />
Mac: <code>DollyXs.sh -q mac-input.xml</code></p>
<p>If we look at mac-project-dir or win-project-dir attributes in the XML document we’ll see the location where the project was created. If you haven&#8217;t used Dolly before, the chance is that you got an error &#8216;Failed to create output file… ‘ when trying to create a project. It is because your mac-project-dir or win-project-dir point to an invalid location, like:</p>
<p><code>mac-project-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"/id8sdk/build/mac/prj"</span></code></p>
<p>In the next part, we&#8217;ll try and use our own XML input file to generate projects using Dolly command line tool.</p>
<h2>Creating custom input file</h2>
<p>Copy win-input.xml or mac-input.xml and rename it myInputFile.xml. This is going to be the file we&#8217;ll be working on.</p>
<p>We’ll now define some general information about our plugin. Open myInputFile.xml and change author field to your name. Edit the value of long-name and change it to &#8220;MyPlugin&#8221;.</p>
<p><code>author<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"Alex"</span><br />
long-name<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"MyPlugin"</span></code></p>
<p>We&#8217;ll also update the location of our project to something more suitable. That should fix any errors that we might have encountered before. Change mac-project-dir to /build/mac/prj and win-project-dir to /build/win/prj.</p>
<p><code>mac-project-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"/Users/Alex/Desktop/Adobe_InDesign_CS6_Plugin_SDK/build/mac/prj"</span><br />
win-project-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"/Users/Alex/Desktop/Adobe_InDesign_CS6_Plugin_SDK/build/win/prj"</span></code></p>
<p>Dolly is going to generate some .cpp and header files for us. Let’s put them all in the same place so they are easily accessible. We can do this by assigning the same path to mac-id-header-dir, mac-source-dir, win-id-header-dir and win-source-dir. Make sure to use backslash for Windows paths or Dolly will throw an error when generating the project.</p>
<p><code>mac-id-header-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"../../../source/sdksamples/myplugin"</span><br />
mac-source-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"../../../source/sdksamples/myplugin"</span><br />
win-id-header-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\..\..\source\sdksamples\myplugin"</span><br />
win-source-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\..\..\source\sdksamples\myplugin"</span></code></p>
<p>Even though we&#8217;re defining paths for source and header files twice, Dolly will create just one copy of each file. If you&#8217;re using Windows, Dolly will not create files in directories defined for Mac and vice versa.</p>
<p>The last changes we&#8217;re going to make are prefix-id and short-name. We&#8217;ll also set the type of our plug-in. The prefix-id of a plug-in is the ID value that InDesign will use to identify our plug-in. It is used to determine IDs of the boss classes, implementations and interfaces in our project. It must be a hexadecimal value. For the purpose of this tutorial, let’s set it to “0xef190”. For your own plug-ins, you need to obtain a unique prefix-id from <a href="http://www.adobe.com/devnet/indesign/prefix_reg.html">Adobe Developers Connection</a>.</p>
<p>Change the value of short-name to &#8220;MP&#8221;, short for MyPlugin. This attribute is used to prefix project file names for your plug-in. Therefore, it is advisable to keep it short.</p>
<p><code>prefix-id<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"0xef190"</span><br />
short-name<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"MP"</span></code></p>
<p>We&#8217;re going to set the type of our plug-in to kUIPlugIn. Make sure the letter <code>I</code> is capital or Dolly will create a model plug-in instead.</p>
<p><code>plugin-type<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"kUIPlugIn"</span></code></p>
<h2>Generating MyPlugin</h2>
<p>It’s time to use our XML file to generate MyPlugin project with Dolly.</p>
<p>Windows: <code>DollyXs.bat -q myInputFile.xml</code><br />
Mac: <code>DollyXs.sh -q myInputFile.xml</code></p>
<p>Once we run the command, Dolly is going to generate source files in /source/sdksamples/myplugin/ as we specified in our XML file.<br />
<a href="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-21-at-13.05.36-e1361790952648.png"><img src="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-21-at-13.05.36-e1361790952648.png" alt="Screen Shot 2013-02-21 at 13.05.36" width="410" height="252" class="alignnone size-full wp-image-153" /></a></p>
<p>Same with the project files. Our Xcode MyPlugin project will be generated in /build/mac/prj and Visual Studio project will be in /build/win/prj .</p>
<p><a href="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-21-at-13.05.00-e1361791000977.png"><img src="http://blogs.adobe.com/indesignsdk/files/2013/02/Screen-Shot-2013-02-21-at-13.05.00-e1361791000977.png" alt="Screen Shot 2013-02-21 at 13.05.00" width="410" height="257" class="alignnone size-full wp-image-152" /></a></p>
<p>Open either MyPlugin.xcodeproj or MyPlugin.sln and you’re done! You’ve successfully created an InDesign plug-in using Dolly.</p>
<h2>Find out more</h2>
<p>If you would like to know more about manipulating the XML input file or Dolly in general, be sure to read the Readme.txt located in /devtools/sdktools/dollyxs/. You can find more information on InDesign Plugin development in the getting-started.pdf in /docs/guides/.</p>
<p>We welcome questions and comments!</p>
<h2>myInputFile.xml</h2>
<p><code><span style="color: #0000ff;">&lt;?xml version=</span><span style="color: #ad0000;">"1.0"</span> <span style="color: #0000ff;">encoding=</span><span style="color: #ad0000;">"UTF-8"</span><span style="color: #0000ff;">?&gt;</span><br />
<span style="color: #0000ff;"> &lt;code</span></p>
<p style="padding-left: 30px;">author<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"Alex"</span><br />
long-name<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"MyPlugin"</span><br />
mac-debug-target-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"../debug/sdk"</span><br />
mac-id-header-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"../../../source/sdksamples/myplugin"</span><br />
mac-project-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"/Users/Alex/Desktop/Adobe_InDesign_CS6_Plugin_SDK/build/mac/prj"</span><br />
mac-release-target-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"../release/sdk"</span><br />
mac-sdk-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"../../.."</span><br />
mac-source-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"../../../source/sdksamples/myplugin"</span><br />
mac-target-type<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"i386"</span><br />
product-type<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"kInDesignProduct, kInCopyProduct"</span><br />
plugin-type<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"kUIPlugIn"</span><br />
prefix-id<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"0xef190"</span><br />
short-name<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"MP"</span><br />
win-debug-intermediate-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\objD"</span><br />
win-debug-target-dir<span style="color: #0000ff;">=</span>"..\debug\sdk"<br />
win-id-header-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\..\..\source\sdksamples\myplugin"</span><br />
win-project-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"/Users/Alex/Desktop/Adobe_InDesign_CS6_Plugin_SDK/build/win/prj"</span><br />
win-release-intermediate-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\objR"</span><br />
win-release-target-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\release\sdk"</span><br />
win-sdk-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\..\.."</span><br />
win-source-dir<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"..\..\..\source\sdksamples\myplugin"</span><br />
<span style="color: #0000ff;">&gt;</span><br />
<span style="color: #0000ff;"> &lt;vcproj-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;rsp-cpp-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;rsp-odfrc-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;xcodeproj-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;xcconfig-plugin-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;xcconfig-plugin-debug-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;xcconfig-plugin-release-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;id-h-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;id-cpp-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;nostrip-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;triggerresourcedeps-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;factorylist-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;rc-file/&gt;&lt;fr-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;enus-fr-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;jajp-fr-file/&gt;</span><br />
<span style="color: #0000ff;"> &lt;generate-menu/&gt;</span><br />
<span style="color: #0000ff;"> &lt;impl-item</span> impl-file<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"actioncomponent-impl-file"</span> impl-id<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"kDollyActionComponentImpl"</span> impl-name<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"DollyActionComponent"</span><span style="color: #0000ff;">/&gt;</span><br />
<span style="color: #0000ff;"> &lt;generate-dialog/&gt;</span><br />
<span style="color: #0000ff;"> &lt;impl-item</span> impl-file<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"dialogcontroller-impl-file"</span> impl-id<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"kDollyDialogControllerImpl"</span><br />
impl-name<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"DollyDialogController"</span><span style="color: #0000ff;">/&gt;</span><br />
<span style="color: #0000ff;"> &lt;impl-item</span> impl-file<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"dialogobserver-impl-file"</span> impl-id<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"kDollyDialogObserverImpl"</span> impl-name<span style="color: #0000ff;">=</span><span style="color: #ad0000;">"DollyDialogObserver"</span><span style="color: #0000ff;">/&gt;</span><br />
<span style="color: #0000ff;"> &lt;generate-panel/&gt;</span></p>
<p><span style="color: #0000ff;">&lt;/code&gt;</span><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2013/02/dollyxs-command-line-tool.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using EVE for UI layout</title>
		<link>http://blogs.adobe.com/indesignsdk/2012/12/using-eve-for-layout.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2012/12/using-eve-for-layout.html#comments</comments>
		<pubDate>Wed, 19 Dec 2012 16:20:46 +0000</pubDate>
		<dc:creator>Timothy Brand-Spencer</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/?p=32</guid>
		<description><![CDATA[The Adobe Express View Engine (EVE) is the recommended method of laying out UI widgets in InDesign dialogs. The main benefit of using EVE is that widget geometry is calculated for you, so that when you add or remove widgets &#8230; <a href="http://blogs.adobe.com/indesignsdk/2012/12/using-eve-for-layout.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The Adobe Express View Engine (EVE) is the recommended method of laying out UI widgets in InDesign dialogs. The main benefit of using EVE is that widget geometry is calculated for you, so that when you add or remove widgets to a dialog all of the other widgets are shifted automatically without you having to recalculate sizes etc.</p>
<h2>Benefits of using EVE</h2>
<ul>
<li>Updating dialogs by adding and removing widgets is made easier because the layout of all widgets is adjusted for you.</li>
<li>Where text is different sizes on different operating systems you don&#8217;t have to worry about calculating extra whitespace.</li>
<li>English dialogs can be smaller because you don&#8217;t need to leave room for anticipated localised text, so your dialogs look good in all languages.</li>
<li>EVE automatically resizes text, buttons, checkboxes, radio buttons and drop-down lists so you needn&#8217;t worry about text being clipped.</li>
</ul>
<h2>A quick introduction to EVE</h2>
<p>In order to use EVE widgets in your dialog definitions you&#8217;ll need to add an include to your FR file.</p>
<p><code>#include "EveInfo.fh"</code></p>
<p>This file is a very useful resource since it lists all of the EVE widgets which are available out of the box, so do have a look inside.</p>
<p>In order to have your dialog use EVE you&#8217;ll need to add WidgetEveInfo to its type definition.</p>
<p><code><br />
type BscDlgDialogBoss(kViewRsrcType) : DialogBoss(ClassID = kBscDlgDialogBoss)<br />
{<br />
&nbsp;&nbsp;&nbsp;WidgetEveInfo;<br />
};<br />
</code></p>
<p>Finally you can change your dialog definition to use EVE by changing it to use EVE widgets and by adding the necessary EVE layout constants to the dialog itself (since you&#8217;ve now made the dialog an EVE dialog by adding WidgetEveInfo to its type definition).</p>
<p>Since all dialogs have an OK and Cancel button and some other content, here&#8217;s a complete dialog definition that uses EVE to layout an OK and Cancel button.</p>
<p><code><br />
resource BscDlgDialogBoss (kSDKDefDialogResourceID + index_enUS)<br />
{<br />
&nbsp;&nbsp;&nbsp;__FILE__, __LINE__,<br />
&nbsp;&nbsp;&nbsp;kBscDlgDialogWidgetID,		// WidgetID<br />
&nbsp;&nbsp;&nbsp;kPMRsrcID_None,				// RsrcID<br />
&nbsp;&nbsp;&nbsp;kBindNone,					// Binding<br />
&nbsp;&nbsp;&nbsp;Frame(0,0,388,112)			// Frame (l,t,r,b)<br />
&nbsp;&nbsp;&nbsp;kTrue, kTrue,				// Visible, Enabled<br />
&nbsp;&nbsp;&nbsp;kBscDlgDialogTitleKey,		// Dialog name<br />
&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Add dialog content here (like EVEStaticTextWidget..)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EVEGenericPanelWidget<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kInvalidWidgetID,	// WidgetId<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0					// RsrcId<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kBindNone,			// Frame binding<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frame(0,0,0,0)		// Frame is 0 for auto-sizing<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kTrue,				// Visible<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kTrue,				// Enabled<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kEVEAlignLeft | kEVELargeSpaceAfter | kEVEArrangeChildrenInColumn,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EVEDefaultButtonWidget<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kOKButtonWidgetID,		// WidgetID<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kSysButtonPMRsrcId,		// RsrcID<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kBindNone,				// Binding<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frame(0,0,0,0)			// Frame (l,t,r,b)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kTrue, kTrue,			// Visible, Enabled<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kSDKDefOKButtonApplicationKey,	// Button text</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kEVELargeSpaceAfter,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EVECancelButtonWidget<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kCancelButton_WidgetID,	// WidgetID<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kSysButtonPMRsrcId,		// RsrcID<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kBindNone,				// Binding<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frame(0,0,0,0)	// Frame (l,t,r,b)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kTrue, kTrue,			// Visible, Enabled<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kSDKDefCancelButtonApplicationKey,	// Button name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kTrue,					// Change to Reset on option-click.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kEVELargeSpaceAfter,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  // End of EVE Generic panel child widgets<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;), // End of EVE Generic panel widget definition</p>
<p>&nbsp;&nbsp;&nbsp;},<br />
&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;kEVEArrangeChildrenInRow | kEVESmallMargin,<br />
};<br />
</code></p>
<p>If you are familiar with InDesign plug-in development you&#8217;ll notice that the general format of the dialog definition is the same as usual except for some EVE layout additions and the use of widget names prefixed with EVE.</p>
<h2>How do I convert my existing dialogs to use EVE?</h2>
<p>The InDesign plug-in SDK includes an EVEConverter tool which enables you to very quickly EVE-ize your dialog definitions however it&#8217;s output is less than optimal. Be aware that the tool will also convert any panel definitions to use EVE so you should keep a backup copy of your original FR file so that you can replace the EVE-ized panel definition with your original non-EVE panel definition. The EVEConverter tool is a great first step to get a feel for EVE and how to use it.</p>
<p>Once you are better acquainted with EVE it becomes easier to hand craft your conversions or do some of them by hand. It all depends on how complex your dialogs are and if you are using any custom widgets. As a rule of thumb you might use the EVE converter first, then go over the output by hand to remove any excess spacer widgets or superfluous generic panel definitions.</p>
<p>The plug-in SDK also includes a porting guide which includes a chapter on using EVE. You can obtain the plug-in SDK from here <a title="InDesign SDKs" href="http://www.adobe.com/devnet/indesign/sdk.html" target="_blank">http://www.adobe.com/devnet/indesign/sdk.html</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2012/12/using-eve-for-layout.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Running a script from an InDesign plug-in</title>
		<link>http://blogs.adobe.com/indesignsdk/2012/12/running-a-script-from-an-indesign-plug-in.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2012/12/running-a-script-from-an-indesign-plug-in.html#comments</comments>
		<pubDate>Wed, 19 Dec 2012 10:05:31 +0000</pubDate>
		<dc:creator>Timothy Brand-Spencer</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/?p=19</guid>
		<description><![CDATA[Perhaps you&#8217;ve come to native plug-in development from a more script-based background, or perhaps you have some existing script code you want to reuse in a new plug-in project. Whatever your background, it&#8217;s really handy to be able to run &#8230; <a href="http://blogs.adobe.com/indesignsdk/2012/12/running-a-script-from-an-indesign-plug-in.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Perhaps you&#8217;ve come to native plug-in development from a more script-based background, or perhaps you have some existing script code you want to reuse in a new plug-in project. Whatever your background, it&#8217;s really handy to be able to run a script from a native plug-in, and it&#8217;s also surprisingly easy.</p>
<p>The code below works out of the box so you can copy and paste as much as you please.</p>
<p><code>#include "IScriptManager.h"<br />
#include "IScriptEngine.h"<br />
#include "IScriptRunner.h"<br />
#include "IScriptUtils.h"<br />
#include "JavaScriptID.h"</p>
<p>InterfacePtr&lt;IScriptManager&gt; scriptManager(Utils&lt;IScriptUtils&gt;()-&gt;QueryScriptManager(kJavaScriptMgrBoss));<br />
if (!scriptManager)<br />
{<br />
&nbsp;&nbsp;&nbsp;return;<br />
}</p>
<p>InterfacePtr&lt;IScriptEngine&gt; scriptEngine(scriptManager-&gt;QueryDefaultEngine());<br />
if (!scriptEngine)<br />
{<br />
&nbsp;&nbsp;&nbsp;return;<br />
}</p>
<p>InterfacePtr&lt;IScriptRunner&gt; scriptRunner(scriptEngine, UseDefaultIID());<br />
if (!scriptRunner)<br />
{<br />
&nbsp;&nbsp;&nbsp;return;<br />
}</p>
<p>RunScriptParams params(scriptRunner);<br />
scriptRunner-&gt;RunScript("alert('hello, world!');", params);</code></p>
<p>The above code uses JavaScript but you may use any script manager you like, including kAppleScriptMgrBoss for AppleScript and kOLEAutomationMgrBoss for Visual Basic. For a complete list of available scripting managers see ‘Script managers’ in chapter 10 ‘Scriptable Plug-in Fundamentals’ of the Programming Guide Volume 1 included in the plug-in SDK (available at <a title="InDesign SDKs" href="http://www.adobe.com/devnet/indesign/sdk.html" target="_blank">http://www.adobe.com/devnet/indesign/sdk.html</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2012/12/running-a-script-from-an-indesign-plug-in.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InDesign Server / OmniORB and Upgrading to Mac OS 10.6</title>
		<link>http://blogs.adobe.com/indesignsdk/2009/09/indesign_server_omniorb_and_up.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2009/09/indesign_server_omniorb_and_up.html#comments</comments>
		<pubDate>Wed, 23 Sep 2009 14:14:22 +0000</pubDate>
		<dc:creator>Heath Lynn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/2009/09/indesign_server_omniorb_and_up.html</guid>
		<description><![CDATA[Here&#8217;s a nugget that will be of interest to those of you who regenerate Java/CORBA support for InDesign Server on the Mac. If you upgrade to Mac OS 10.6, you must rebuild the OmniORB tools with an x86_64 target to &#8230; <a href="http://blogs.adobe.com/indesignsdk/2009/09/indesign_server_omniorb_and_up.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a nugget that will be of interest to those of you who regenerate Java/CORBA support for InDesign Server on the Mac.  If you upgrade to Mac OS 10.6, you must rebuild the OmniORB tools with an x86_64 target  to ensure that they run correctly.  Setting up the OmniORB tools is coverred in Regenerating the Adobe InDesign CS4 Server Java API.  You should get the x86_64 target by rebuilding the tools on the upgraded machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2009/09/indesign_server_omniorb_and_up.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash UIs with InDesign CS4</title>
		<link>http://blogs.adobe.com/indesignsdk/2009/05/flash_uis_with_indesign_cs4.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2009/05/flash_uis_with_indesign_cs4.html#comments</comments>
		<pubDate>Tue, 26 May 2009 21:29:04 +0000</pubDate>
		<dc:creator>Heath Lynn</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/2009/05/flash_uis_with_indesign_cs4.html</guid>
		<description><![CDATA[InDesign user-interface development can be expensive. It takes a lot of effort to implement a dialog or panel in ODFRC. Things should improve in future versions, with the possibility of using Flash-based user-interface tools like Flex and FlexBuilder. While this &#8230; <a href="http://blogs.adobe.com/indesignsdk/2009/05/flash_uis_with_indesign_cs4.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>InDesign user-interface development can be expensive. It takes a lot of effort to implement a dialog or panel in ODFRC. Things should improve in future versions, with  the possibility of using Flash-based user-interface tools like Flex and FlexBuilder. While this   represents the future direction of InDesign user-interface development, there is a present reality in InDesign CS4. With an understanding of the current situation, you can  implement Flash-based user-interfaces for InDesign CS4.</p>
<p><span id="more-11"></span></p>
<p>This posting highlights two samples that demonstrate  two approaches &#8212; scripting and plug-in &#8212; to   using Flex to create user interfaces for InDesign CS4. Each  approach demonstrates how to achieve the following:</p>
<ol>
<li>Locate an SWF (binary Flash file) relative to a script or plug-in.</li>
<li>Load the SWF in an existing InDesign user-interface widget.</li>
<li>Provide a way to call InDesign  from the SWF&#8217;s ActionScript code. (You cannot directly target InDesign CS4&#8242;s scripting DOM with ActionScript.)</li>
<li>Provide a way to call ActionScript  from InDesign code.</li>
</ol>
<h2> Scripting Approach</h2>
<p>The scripting approach combines InDesign JavaScript (and its ScriptUI library) with Flash SWF. This was demonstrated originally in the InDesign CS4 Products SDK by the FlexUIBasicScriptUI sample. That sample shows how to create a panel with Flex and ScriptUI. Perhaps more than anything, it highlights the panel&#8217;s need to receive notifications from the application when relevant data changes. Since these notifications do not exist in the scripting DOM, I  recommend using this approach for dialogs, which do not require notifications.</p>
<p>To back up the claim that this is a good technique for dialogs, and to demonstrate how you would do this, I implemented a new sample. It is demonstrated in the following video, which shows a simple dialog implemented with Flex and scripting. Eventually, we will add this sample to the SDK and maintain it there, but for your convenience, I have added <a href="http://blogs.adobe.com/indesignsdk/flashuiswithcs4/FlexScriptUIDialog.zip">rough and ready (CS4-compatible) sample files.</a></p>
<p><object width="480" height="383"><param name="movie" value="http://blogs.adobe.com/indesignsdk/flashuiswithcs4/flash-dialog-scripting.swf" /><param name="quality" value="high" /><embed src="http://blogs.adobe.com/indesignsdk/flashuiswithcs4/flash-dialog-scripting.swf" type="application/x-shockwave-flash" width="480" height="383"></embed></object></p>
<p>To run the sample, copy FlexScriptUIDialog.swf and FlexScriptUIDialog.jsx to your &#8220;Startup Scripts&#8221; folder (<em>&lt;InDesign&gt;</em>/Scripts/Startup Scripts). Note: <em>&lt;InDesign&gt;</em> is the InDesign application folder.</p>
<p>For details, see the comments in the included source files.</p>
<p>For information on how to compile the SWF, see <a href="#BuildingFlexFiles">Building Flex Files</a> below.</p>
<h2>Plug-In Approach</h2>
<p>The plug-in approach can be used to implement more sophisticated user interfaces. The main difference from the scripting approach is that you can create a panel that behaves  like a normal InDesign panel. (Script UI panels have a different appearance and do not behave like InDesign panels.)  This includes the ability to watch for changes in a document and update the panel accordingly.</p>
<p>The InDesign CS4 Products SDK includes the FlexUIStroke sample. This sample demonstrates combining a  C++ plug-in development with Flex. The plug-in portion provides the following:</p>
<ul>
<li>A native panel containing a Flash player widget</li>
<li>An  observer that watches for changes to the stroke weight in the current selection and updates the panel accordingly</li>
<li>Code that alters the stroke weight in the InDesign object model</li>
</ul>
<p>The following video  demonstrates what is possible using the plug-in approach.</p>
<p><object width="480" height="383"><param name="movie" value="http://blogs.adobe.com/indesignsdk/flashuiswithcs4/flash-panel-plugin.swf" /><param name="quality" value="high" /><embed src="http://blogs.adobe.com/indesignsdk/flashuiswithcs4/flash-panel-plugin.swf" type="application/x-shockwave-flash" width="480" height="383"></embed></object></p>
<p>For details on this panel, see the documentation and source code in the InDesign CS4 Products SDK. Each sample is documented in the API Reference. Click on Samples &gt; All Samples &gt;, then select the FlexUIStroke sample.</p>
<p>For information on how to compile the SWF, see <a href="#BuildingFlexFiles">Building Flex Files</a> below.</p>
<p>You will find the plug-in in one of the following locations (depending on your platform) in the SDK:</p>
<ul>
<li><em>&lt;SDK&gt;</em>/build/win/prj/FlexUIStroke.sdk.vcproj</li>
<li><em>&lt;SDK&gt;</em>/build/mac/prj/FlexUIStroke.sdk.xcodeproj</li>
</ul>
<h2><a name="BuildingFlexFiles" id="BuildingFlexFiles"></a>Building Flex Files</h2>
<p>To import and compile either Flex project using FlexBuilder 3, follow these steps :</p>
<ol>
<li>Run Flex Builder 3.</li>
<li> Choose File &gt; Import &gt; Flex Project&#8230;</li>
<li>Select the Project Folder radio button</li>
<li>Browse to the Flex project folder (this folder should contain the .project file).</li>
<li>Uncheck the &#8220;Use default location&#8221; checkbox.  This allows you to import the project in its current location.</li>
<li>Click Finish.</li>
</ol>
<p>If you do not have FlexBuilder, it is possible to compile these mxml files using the free Flex SDK:</p>
<ul>
<li>mxmlc &lt;&#8230;&gt;/flexscriptuidialog/FlexScriptUIDialog.mxml</li>
<li>mxmlc &lt;&#8230;&gt;/flexuistroke/flexuistrokemxml/src/flexuistroke.mxml</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2009/05/flash_uis_with_indesign_cs4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting InDesign CS4 Preflight</title>
		<link>http://blogs.adobe.com/indesignsdk/2009/03/scripting_indesigncs4_prefligh_1.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2009/03/scripting_indesigncs4_prefligh_1.html#comments</comments>
		<pubDate>Mon, 09 Mar 2009 16:22:53 +0000</pubDate>
		<dc:creator>Heath Lynn</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/2009/03/scripting_indesigncs4_prefligh_1.html</guid>
		<description><![CDATA[We’ve received numerous requests for sample scripts that demonstrate working with the Adobe InDesign CS4 new live preflight feature. Several of these requests have come from InDesign Server partners who want to know how to use the new preflight engine. &#8230; <a href="http://blogs.adobe.com/indesignsdk/2009/03/scripting_indesigncs4_prefligh_1.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>We’ve received numerous requests for sample scripts that  demonstrate working with the Adobe InDesign CS4 new live preflight feature.  Several of these requests have come from  InDesign Server partners who want to know how to use the new preflight  engine.  My Creative Suite Developer  Technologies teammate Joe Stinson and I collaborated on the following information that we think will save you a lot of time when trying to script the new  preflight feature.</p>
<p>If you are not familiar with preflight, please first watch  this introductory video:<br />
<a href="http://www.adobe.com/designcenter/indesign/articles/lrvid4025_id.html">	http://www.adobe.com/designcenter/indesign/articles/lrvid4025_id.html</a>).  
</p>
<p>This post will demonstrate how to interact with the  preflight system using JavaScript.  For illustration purposes, we show how to  configure preflight to raise an error if the page size is something other than  letter size (8.5”X 11”).  We briefly  highlight how it’s done in the UI, then show how to achieve the same results  through scripting.</p>
<p><span id="more-10"></span></p>
<h3>Importing a Preflight Profile</h3>
<p>You can import a preflight profile through the Preflight  Panel in InDesign: choose Preflight Panel &gt; Define Profiles, then choose  Load Profile from the drop-down menu in the Preflight Profiles window.</p>
<p><img src="http://blogs.adobe.com/indesignsdk/images/preflight/LoadProfiles.jpg" width="400" height="266" alt="Load Profiles" /></p>
<p>You also can load a profile with scripting.  The following JavaScript imports a profile  called Test.idpp:</p>
<div class="code">
<p>var profile =  app.loadPreflightProfile(File(&quot;/c/Test.idpp&quot;));</p>
<p>//If a profile was not loaded<br />if (profile == null)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;The profile  did not load successfully&quot;);<br />}</p>
</div>
<p>It’s  easier  to create profiles using the Preflight Panel than with scripting.  One workflow would be to create all profiles  in the UI, export them to files, and import them using scripting.  This approach avoids the challenges involved  with manually adding rules via JavaScript.</p>
<h3>Creating a Profile</h3>
<p>To create a preflight  profile from the Preflight Panel, choose Preflight Panel &gt; Define Profiles,  then choose the plus sign (+) to add a new preflight profile.  Name the profile and fill in all data values  for the available rules.</p>
<p><img src="http://blogs.adobe.com/indesignsdk/images/preflight/DefineProfiles.jpg" width="400" height="269" alt="Define Profiles" /></p>
<p>You also can create a profile with scripting.  The following adds a single profile called  Test:</p>
<div class="code">
<p>//add profile<br />var profile = app.preflightProfiles.add();<br />profile.name = &quot;Test&quot;;<br />profile.description = &quot;Test description&quot;;</p>
</div>
<p>Preflight-profile names must be unique.  If the script above is executed more than  once within the same InDesign instance, an error is raised, indicating that a  profile with that name already exists.   To avoid this, either access the existing profile using  app.preflightProfiles.itemByName(), or check to see if a profile exists and  remove it as follows: </p>
<div class="code">
<p>function removeProfile(name)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;//Lookup the existing Preflight  Profile by name<br />&nbsp;&nbsp;&nbsp;&nbsp;var oldProfile = app.preflightProfiles.itemByName(name);<br />&nbsp;&nbsp;&nbsp;&nbsp;//If a profile with that name was  found<br />&nbsp;&nbsp;&nbsp;&nbsp;if (oldProfile != null)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oldProfile.remove();<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</p>
</div>
<h3>Adding Rules</h3>
<p>A preflight profile contains a mutually exclusive set of  rules.  To add a rule to a profile,  follow these steps:</p>
<ol>
<li>Add a rule to a profile by name.</li>
<li>Set the rule’s data values.</li>
<li>Set the rule’s reporting state.</li>
</ol>
<p>Each step is described below.</p>
<p><strong>1. Add a rule to a profile by name.</strong>Rules are added by name.    For information on rule names, see <a href="#AvailableRules">“Available Rules.”</a>  The following adds the  ADBE_PageSizeOrientation rule to the profile:</p>
<div class="code">
<p>//Add a rule that requires a  specific page size and orientation (Portrait or Landscape). <br />const RULE_NAME = &quot;ADBE_PageSizeOrientation&quot;;<br />var rule = profile.preflightProfileRules.add(RULE_NAME);</p>
</div>
<p><strong>2. Set the rule’s data values.</strong>Many, but not all, rules have data  properties.  For a complete specification  of the rules available with InDesign CS4, see “Available Rules.”  The ADBE_PageSizeOrientation rule contains  particular data properties that allow you to specify a page size.  The following sets the acceptable page height  and width, a tolerance (fudge factor), and an option for handling page  orientation:</p>
<div class="code">
<p>//Requires the page size to be  8.5 in x 11in (Letter Size)<br />//<br />//enters a value for tolerance<br />rule.ruleDataObjects.add(&quot;tolerance&quot;, RuleDataType.realDataType,  0.01);</p>
<p>//Sets the width  to the point equivalent  of 8.5 inches<br />rule.ruleDataObjects.add(&quot;width&quot;, RuleDataType.realDataType,  612);</p>
<p>// Sets the width  to the point  equivalent of 11 inches<br />rule.ruleDataObjects.add(&quot;height&quot;, RuleDataType.realDataType,  792);</p>
<p>//true = ignore orientation is checked<br />rule.ruleDataObjects.add(&quot;ignore_orientation&quot;, RuleDataType.booleanDataType,  true);</p>
</div>
<p><strong>3. Set the rule’s reporting state.</strong>This is done using the rule’s flag  property.  There are several choices  (disabled, information, warning, and error), controlled by the  PreflightRuleFlag enumeration:</p>
<div class="code">
<p>//set the rule to return an  error<br />rule.flag = PreflightRuleFlag.returnAsError;</p>
</div>
<h3>Processing a Profile</h3>
<p>In the desktop version of InDesign, preflight errors are  reported in the UI.  In scripting  (especially for InDesign Server), the errors are generated on demand.  The following script processes an InDesign  document.  If there are errors, it writes  the results to a new PDF file.  For an  example of the output, see the figure below the example.</p>
<div class="code">
<p>//Process the doc with the rule<br />var process = app.preflightProcesses.add(doc, profile);<br />process.waitForProcess();<br />results = process.processResults;</p>
<p>//If Errors were found<br />if (results != ‘None’)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;//Export  the file to PDF<br />&nbsp;&nbsp;&nbsp;&nbsp;//The  “true” value selects to open the file after export.<br />&nbsp;&nbsp;&nbsp;&nbsp;process.saveReport(File(&quot;/c/PreflightResults.pdf&quot;),  true);<br />}</p>
<p>//Cleanup<br />process.remove();</p>
</div>
<p><img src="http://blogs.adobe.com/indesignsdk/images/preflight/PreflightPDFReport.jpg" width="400" height="138" alt="Preflight Report" /></p>
<p>If you would rather produce a text file, simply name your  output file with a .txt extension.<br />Alternately, you may prefer to iterate the errors  yourself.  The following demonstrates how  to access the errors array:</p>
<div class="code">
<p>//array containing detailed  results<br />errors = process.aggregatedResults;</p>
</div>
<h3>Custom Rules</h3>
<p>It is not possible to create custom rules through the  Preflight Panel or scripting; however, this can be done through a C++  plug-in.  The InDesign CS4 Products SDK  contains a sample, PreflightRule, that demonstrates how to add custom rules  with a plug-in.</p>
<h3><a name="#AvailableRules" id="#AvailableRules" />Available Rules</h3>
<p>One of the hardest aspects about scripting rules is  discovering rule names and properties.   Due to the dynamic nature of rules (they really are just strings),  specific rule names and properties do not show up in the Extend Script Tool  Kit’s Object Model Viewer.  There are a  couple ways to discover this information.   For your convenience, we’ve written a script that produces the following  output.  This script (dumpLivePreflightRules.jsx) will be added to a  future version of the SDK.  If you use  a plug-in that adds custom rules, you’ll need to run the script to extract  the new names and properties.</p>
<p>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td>Rule Name</td>
<td>Rule Properties</td>
</tr>
<tr>
<td>ADBE_BlankPages</td>
<td><a href="#ADBE_BlankPages">yes</a></td>
</tr>
<tr>
<td>ADBE_BleedSlug</td>
<td><a href="#ADBE_BleedSlug">yes</a></td>
</tr>
<tr>
<td>ADBE_BleedTrimHazard</td>
<td><a href="#ADBE_BleedTrimHazard">yes</a></td>
</tr>
<tr>
<td>ADBE_CMYPlates</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_Colorspace</td>
<td><a href="#ADBE_Colorspace">yes</a></td>
</tr>
<tr>
<td>ADBE_ConditionIndicators</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_CrossReferences</td>
<td><a href="#ADBE_CrossReferences">yes</a></td>
</tr>
<tr>
<td>ADBE_FontUsage</td>
<td><a href="#ADBE_FontUsage">yes</a></td>
</tr>
<tr>
<td>ADBE_ImageColorManagement</td>
<td><a href="#ADBE_ImageColorManagement">yes</a></td>
</tr>
<tr>
<td>ADBE_ImageResolution</td>
<td><a href="#ADBE_ImageResolution">yes</a></td>
</tr>
<tr>
<td>ADBE_InteractiveContent</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_LayerVisibility</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_MissingFonts</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_MissingGlyph</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_MissingModifiedGraphics</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_OPI</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_Overprint</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_OversetText</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_PageCount</td>
<td><a href="#ADBE_PageCount">yes</a></td>
</tr>
<tr>
<td>ADBE_PageSizeOrientation</td>
<td><a href="#ADBE_PageSizeOrientation">yes</a></td>
</tr>
<tr>
<td>ADBE_Registration</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_ScaledGraphics</td>
<td><a href="#ADBE_ScaledGraphics">yes</a></td>
</tr>
<tr>
<td>ADBE_ScaledType</td>
<td><a href="#ADBE_ScaledType">yes</a></td>
</tr>
<tr>
<td>ADBE_SmallText</td>
<td><a href="#ADBE_SmallText">yes</a></td>
</tr>
<tr>
<td>ADBE_SpellCheck</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_SpotColorSetup</td>
<td><a href="#ADBE_SpotColorSetup">yes</a></td>
</tr>
<tr>
<td>ADBE_StrokeRequirements</td>
<td><a href="#ADBE_StrokeRequirements">yes</a></td>
</tr>
<tr>
<td>ADBE_TextOverrides</td>
<td><a href="#ADBE_TextOverrides">yes</a></td>
</tr>
<tr>
<td>ADBE_TransparencyBlending</td>
<td><a href="#ADBE_TransparencyBlending">yes</a></td>
</tr>
<tr>
<td>ADBE_TransparencyUsage</td>
<td>no</a></td>
</tr>
<tr>
<td>ADBE_WhiteOverprint</td>
<td>no</a></td>
</tr>
</table>
<p>
<hr />
<h3><a name="#ADBE_BlankPages" id="#ADBE_BlankPages">ADBE_BlankPages</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_master</td>
<td>true</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_nonprinting</td>
<td>true</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_BleedSlug" id="#ADBE_BleedSlug">ADBE_BleedSlug</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_b</td>
<td>9</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_b_aux</td>
<td>9</td>
</tr>
<tr>
<td>Integer</td>
<td>bleed_comparison_type</td>
<td>3</td>
</tr>
<tr>
<td>Boolean</td>
<td>bleed_enabled</td>
<td>true</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_l</td>
<td>9</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_l_aux</td>
<td>9</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_r</td>
<td>9</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_r_aux</td>
<td>9</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_t</td>
<td>9</td>
</tr>
<tr>
<td>Real</td>
<td>bleed_t_aux</td>
<td>9</td>
</tr>
<tr>
<td>Real</td>
<td>slug_b</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>slug_b_aux</td>
<td>18</td>
</tr>
<tr>
<td>Integer</td>
<td>slug_comparison_type</td>
<td>3</td>
</tr>
<tr>
<td>Boolean</td>
<td>slug_enabled</td>
<td>false</td>
</tr>
<tr>
<td>Real</td>
<td>slug_l</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>slug_l_aux</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>slug_r</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>slug_r_aux</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>slug_t</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>slug_t_aux</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>tolerance</td>
<td>0.01</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_BleedTrimHazard" id="#ADBE_BleedTrimHazard">ADBE_BleedTrimHazard</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>binding_enabled</td>
<td>false</td>
</tr>
<tr>
<td>Real</td>
<td>binding_width</td>
<td>1</td>
</tr>
<tr>
<td>Real</td>
<td>live_b</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>live_l</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>live_r</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>live_t</td>
<td>18</td>
</tr>
<tr>
<td>Real</td>
<td>tolerance</td>
<td>0.01</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_Colorspace" id="#ADBE_Colorspace">ADBE_Colorspace</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_cmyk</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_gray</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_lab</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_rgb</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_spot</td>
<td>false</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_CrossReferences" id="#ADBE_CrossReferences">ADBE_CrossReferences</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>xrefs_out_of_date</td>
<td>true</td>
</tr>
<tr>
<td>Boolean</td>
<td>xrefs_unresolved</td>
<td>true</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_FontUsage" id="#ADBE_FontUsage">ADBE_FontUsage</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_ATC</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_Bitmap</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_CID</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_MultipleMaster</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_OpenTypeCFF</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_OpenTypeCID</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_OpenTypeTT</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_TrueType</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_Type1</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_protected</td>
<td>true</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_ImageColorManagement" id="#ADBE_ImageColorManagement">ADBE_ImageColorManagement</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_cmyk_profiles</td>
<td>true</td>
</tr>
<tr>
<td>Boolean</td>
<td>no_image_overrides</td>
<td>true</td>
</tr>
<tr>
<td>Boolean</td>
<td>overrides_exclude_uncal</td>
<td>true</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_ImageResolution" id="#ADBE_ImageResolution">ADBE_ImageResolution</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>bw_max_enabled</td>
<td>false</td>
</tr>
<tr>
<td>Real</td>
<td>bw_max_res</td>
<td>2400</td>
</tr>
<tr>
<td>Boolean</td>
<td>bw_min_enabled</td>
<td>true</td>
</tr>
<tr>
<td>Real</td>
<td>bw_min_res</td>
<td>800</td>
</tr>
<tr>
<td>Boolean</td>
<td>color_max_enabled</td>
<td>false</td>
</tr>
<tr>
<td>Real</td>
<td>color_max_res</td>
<td>1200</td>
</tr>
<tr>
<td>Boolean</td>
<td>color_min_enabled</td>
<td>true</td>
</tr>
<tr>
<td>Real</td>
<td>color_min_res</td>
<td>250</td>
</tr>
<tr>
<td>Boolean</td>
<td>gray_max_enabled</td>
<td>false</td>
</tr>
<tr>
<td>Real</td>
<td>gray_max_res</td>
<td>1200</td>
</tr>
<tr>
<td>Boolean</td>
<td>gray_min_enabled</td>
<td>true</td>
</tr>
<tr>
<td>Real</td>
<td>gray_min_res</td>
<td>250</td>
</tr>
<tr>
<td>Real</td>
<td>tolerance</td>
<td>0.5</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_PageCount" id="#ADBE_PageCount">ADBE_PageCount</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Integer</td>
<td>comparison_type</td>
<td>2</td>
</tr>
<tr>
<td>Integer</td>
<td>comparison_value</td>
<td>1</td>
</tr>
<tr>
<td>Integer</td>
<td>comparison_value_aux</td>
<td>1</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_PageSizeOrientation" id="#ADBE_PageSizeOrientation">ADBE_PageSizeOrientation</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Real</td>
<td>height</td>
<td>792</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_orientation</td>
<td>false</td>
</tr>
<tr>
<td>Real</td>
<td>tolerance</td>
<td>0.01</td>
</tr>
<tr>
<td>Real</td>
<td>width</td>
<td>612</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_ScaledGraphics" id="#ADBE_ScaledGraphics">ADBE_ScaledGraphics</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Real</td>
<td>max_scale</td>
<td>100.5</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_ScaledType" id="#ADBE_ScaledType">ADBE_ScaledType</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_justification</td>
<td>true</td>
</tr>
<tr>
<td>Real</td>
<td>max_scale</td>
<td>100.5</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_SmallText" id="#ADBE_SmallText">ADBE_SmallText</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Real</td>
<td>minSize</td>
<td>4</td>
</tr>
<tr>
<td>Boolean</td>
<td>minSize_trap_safe_only</td>
<td>false</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_SpotColorSetup" id="#ADBE_SpotColorSetup">ADBE_SpotColorSetup</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>lab_spots</td>
<td>true</td>
</tr>
<tr>
<td>Boolean</td>
<td>lab_spots_enabled</td>
<td>false</td>
</tr>
<tr>
<td>Integer</td>
<td>max_spots</td>
<td>1</td>
</tr>
<tr>
<td>Boolean</td>
<td>max_spots_enabled</td>
<td>true</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_StrokeRequirements" id="#ADBE_StrokeRequirements">ADBE_StrokeRequirements</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Real</td>
<td>min_width</td>
<td>0.125</td>
</tr>
<tr>
<td>Boolean</td>
<td>min_width_trap_safe_only</td>
<td>false</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_TextOverrides" id="#ADBE_TextOverrides">ADBE_TextOverrides</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_color_overrides</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_font_overrides</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_kerning_tracking_overrides</td>
<td>false</td>
</tr>
<tr>
<td>Boolean</td>
<td>ignore_language_overrides</td>
<td>false</td>
</tr>
</table>
<p>
<h3><a name="#ADBE_TransparencyBlending" id="#ADBE_TransparencyBlending">ADBE_TransparencyBlending</a></h3>
<table border="1" cellpadding="5">
<tr style="background-color:#EEEEEE">
<td style="width:150px">Data Type</td>
<td style="width:200px">Name</td>
<td style="width:150px">Default Value</td>
</tr>
<tr>
<td>Integer</td>
<td>space</td>
<td>3</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2009/03/scripting_indesigncs4_prefligh_1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validating IDML Based Files</title>
		<link>http://blogs.adobe.com/indesignsdk/2009/03/validating_idml_based_files.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2009/03/validating_idml_based_files.html#comments</comments>
		<pubDate>Fri, 06 Mar 2009 21:31:17 +0000</pubDate>
		<dc:creator>Heath Lynn</dc:creator>
				<category><![CDATA[IDML]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/2009/03/validating_idml_based_files.html</guid>
		<description><![CDATA[IDML is designed to be generated and manipulated by XML tools and programmers. To support this, IDML can be validated against a RelaxNG schema. When it comes to schemas and validation, there are two types of IDML files: There are &#8230; <a href="http://blogs.adobe.com/indesignsdk/2009/03/validating_idml_based_files.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>IDML is designed to be generated and manipulated by XML tools and programmers.  To support this, IDML can be validated against a RelaxNG schema.</p>
<p>When it comes to schemas and validation, there are two types of IDML files: </p>
<ul>
<li>There are many single-file variants (snippets, assignments, ICML, etc.).  These files need to be validated with the snippet schema.</li>
<li>Packages are multi-file ZIP archives that represent an entire InDesign document.  Packages need to be validated with the package schema.<br />
For more information on IDML files see the <a href="http://blogs.adobe.com/indesignsdk/2009/03/idml_file_types.html">“IDML File Types”</a> post.
</li>
</ul>
<h2>Generating Schema Files</h2>
<p>IDML can be extended by the scripting support in third-party plug-ins.  For this reason, the schema used for validation must match a plug-in configuration.  Rather than providing a static schema, InDesign provides a means to create a schema from your plug-in configuration.  The following sample code demonstrates producing snippet and package schemas with JavaScript.</p>
<div class="code">
<blockquote>
<p>// Generate a non-package schema<br />
app.generateIDMLSchema(Folder(&#8220;/idml-schema/snippet&#8221;), false);</p>
<p>// Generate package schema<br />
app.generateIDMLSchema(Folder(&#8220;/idml-schema/package&#8221;), true);</p>
</blockquote>
</div>
<p>This snippet schema is used to validate all single-file variants of IDML.  It comprises two files:</p>
<table width="400" border="1">
<tr valign="top">
<th width="123" scope="col">File</th>
<th width="261" scope="col">Purpose</th>
</tr>
<tr valign="top">
<td><i>datatype.rnc</i></td>
<td>Shared data type file included by all schema files.</td>
</tr>
<tr valign="top">
<td><i>IDMarkupLanguage.rnc</i></td>
<td>Validates all single file IDML variants (ICML, IDMS, ICMA, etc.).</td>
</tr>
</table>
<p>&#160;</p>
<p>The package schema comprises one shared file and schema file for each type of XML file that can appear in an IDML package:</p>
<table width="400" border="1">
<tr valign="top">
<th scope="col">File</th>
<th scope="col">Purpose</th>
</tr>
<tr valign="top">
<td>datatype.rnc</td>
<td>Shared data type file included by all schema files.</td>
</tr>
<tr valign="top">
<td>designmap.rnc</td>
<td>Validates designmap.xml</td>
</tr>
<tr valign="top">
<td>MasterSpreads/MasterSpread.rnc</td>
<td>Validates all master spread files in the MasterSpreads directory.</td>
</tr>
<tr valign="top">
<td>Resources/Fonts.rnc</td>
<td>Validates Fonts.xml.</td>
</tr>
<tr valign="top">
<td>Resources/Graphic.rnc</td>
<td>Validates Graphic.xml.</td>
</tr>
<tr valign="top">
<td>Resources/Preferences.rnc</td>
<td>Validates Preferences.xml.</td>
</tr>
<tr valign="top">
<td>Resources/Styles.rnc</td>
<td>Validates Style.xml.</td>
</tr>
<tr valign="top">
<td>Spreads/Spread.rnc</td>
<td>Validates all spread files in the Spreads directory.</td>
</tr>
<tr valign="top">
<td>Stories/Story.rnc</td>
<td>Validates all story files in the Story directory.</td>
</tr>
<tr valign="top">
<td>XML/BackingStory.rnc</td>
<td>Validates XML/BackingStory.xml</td>
</tr>
<tr valign="top">
<td>XML/Mapping.rnc</td>
<td>Validates XML/Mapping.xml</td>
</tr>
<tr valign="top">
<td>XML/Tags.rnc</td>
<td>Validates XML/Tags.xml</td>
</tr>
</table>
<h2>Finding Errors in IDML</h2>
<p>For demonstration purposes, we need files that contain errors.  Imagine the following IDML fragment in both a snippet file (test.idms) and package (test.idml) file. The IDML contains four fairly obvious errors; try to spot all four.</p>
<div class="code">
<blockquote>
<p>&lt;Spread&gt;<br />
&lt;Rectangle foo=&#8221;Test&#8221; Self=&#8221;uec&#8221; …&gt;<br />
&lt;RectData&gt;&#8230;&lt;/RectData &gt;<br />
&lt;Propertie&gt;&#8230;&lt;/Propertie&gt;<br />
&lt;/Spread&gt;</p>
</blockquote>
</div>
<p>
You may have found it difficult to spot all four errors.  Imagine if this was buried in a huge XML file.  Instead of trying to find errors ourselves, we use schema validation.</p>
<h2>                           Schema Validation Basics</h2>
<p>A RelaxNG schema can be used to verify the structural correctness of a document.  It checks to make sure all XML nodes (elements, attributes, text data, etc.) are used at the right places in the document.  It detects any unknown or unexpected nodes and ensures that required nodes are present.</p>
<p>InDesign’s RelaxNG schemas can be used to check the structure of a document; however, it does not check the content of these nodes.  For example, it doesn’t check that all IDML references exist.  It’s possible to do some non-RelaxNG-based error detection.  This is discussed in “Additional Error Detection” below.</p>
<p>You can validate IDML files with any software that supports the compact form of RelaxNG.  For snippet files, this is relatively straightforward: it amounts to pointing whatever validation engine you are using to the IDMarkupLanguage.rnc file (which includes the datatyps.rnc file).</p>
<p>Validating packages is more complex; there are two difficulties:</p>
<ul>
<li>Packages are ZIP archives, and most RelaxNG validation engines don’t deal with ZIP files.</li>
<li>An IDML package comprises many XML files.  The package schema comprises several schema files: there is one schema for each type of file that can appear in an IDML file.  To validate a package, you need to match each XML file with its appropriate schema file. </li>
</ul>
<h2> Validating with IDMLTools</h2>
<p>The InDesign CS4 Products SDK includes a Java package called IDMLTools.  This package contains a validation application based on the Jing RelaxNG Validator, which handles both snippets and package files.  It’s especially handy for package files, because it unzips the files and matches XML files to the appropriate schema file.<br />
For information about setting up IDMLTools, see the IDML ReadMe.  This amounts to the following:</p>
<ul>
<li>Add the IDMLTOOLS_HOME environment variable.  This should contain the path to your IDMLTools folder.  (Do not terminate with a trailing \ or /.)</li>
<li>Add /bin to your search PATH environment variable.  This provides easy access to the validation script. </li>
</ul>
<p>Once set up, you can validate files by running the appropriate platform script, validate.bat on Windows and validate.sh on Mac OS.  These scripts set the appropriate Java classpath and run the validation application.  The validation application can be used to validate both types of IDML files (snippets and package files).  Running the platform scripts with no arguments produces the following usage message:</p>
<blockquote>
<p>Validator SchemaPath PackagePath [PackagePath...]</p>
</blockquote>
<p>This means you validate by specifying a path to the schema folder, followed by paths to one or more package files that you want to validate.</p>
<h3>Validating a Snippet                           </h3>
<p>To validate the test.idms snippet, specify the path to the snippet schema, followed by the path to the actual snippet:</p>
<blockquote>
<p>validate.bat “c:\idml-schema\snippet” test.idms</p>
</blockquote>
<p>The validation application writes errors to standard error.  Here are the results from validating test.idms:</p>
<blockquote>
<p><em>Test.idms:143:10: error: required attributes missing<br />
Test.idms:144:527: error: attribute &#8220;foo&#8221; not allowed at this point; ignored<br />
Test.idms:145:14: error: element &#8220;RectData&#8221; not allowed in this context<br />
Test.idms:146:15: error: element &#8220;Propertie&#8221; not allowed in this context</em></p>
</blockquote>
<h3>Validating a Package</h3>
<p>To validate a package specify the path to the package schema, followed by the path to the IDML file:</p>
<blockquote>
<p>validate.bat “c:\idml-schema\package” test.idml</p>
</blockquote>
<p>The validation application unzips the archive to a temporary directory, validates each file against the appropriate schema file, then writes any errors to standard error.</p>
<p> Here are the results written when validating test.idml:</p>
<blockquote>
<p><em>Spreads\Spread_ubd.xml:3:245: error: required attributes missing<br />
Spreads\Spread_ubd.xml:27:527: error: attribute &#8220;foo&#8221; not allowed at this point; ignored<br />
Spreads\Spread_ubd.xml:28:14: error: unknown element &#8220;RectData&#8221;<br />
Spreads\Spread_ubd.xml:29:15: error: unknown element &#8220;Propertie&#8221;</em></p>
</blockquote>
<p>Notice that the XML file containing the error is reported on the left.  In this case, the error is in the Spread_ubd.xml file.  Because package validation deals with multiple XML files in one pass, error results can come from several files.</p>
<h3>Interpreting the Results</h3>
<p>From the results above, we can deduce the four errors:</p>
<ol>
<li>The Spread element is missing a required attribute.  Unfortunately, Jing does not report which attribute is missing, but it is easy enough to look at the schema or Adobe InDesign CS4 IDML File Format Specification and determine that it is the Self attribute that is missing.</li>
<li>There is no “foo” attribute on the Rectangle element.</li>
<li>“RectData” is not a child of the Rectangle element.</li>
<li>Rectangle does not have a child element called “Propertie.”  Looking at the schema, Adobe InDesign CS4 IDML File Format Specification, and numerous other examples, we can conclude that this element should be called “Properties” (with an ‘s’).</li>
</ol>
<h3>Additional Error Detection</h3>
<p>The IDMLTools validation application includes some non-RelaxNG-based error detection.   Currently, it checks for the following errors:</p>
<ul>
<li>
<p>Missing designmap.xml file.</p>
</li>
<li>
<p>Missing or improper processing instruction at the top of the designmap.xml file.</p>
</li>
<li>
<p>Missing package files included in designmap.xml; e.g., Spreads/Spread_ubd.xml in the following output: </p>
</li>
</ul>
<p>Because Adobe distributes the source for IDMLTools, it’s possible to add additional error detection.  You’ll find the code for these items in the Validator.preVerifyPackage() method.
</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2009/03/validating_idml_based_files.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IDML File Types</title>
		<link>http://blogs.adobe.com/indesignsdk/2009/03/idml_file_types.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2009/03/idml_file_types.html#comments</comments>
		<pubDate>Fri, 06 Mar 2009 19:32:54 +0000</pubDate>
		<dc:creator>Heath Lynn</dc:creator>
				<category><![CDATA[IDML]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/2009/03/idml_file_types.html</guid>
		<description><![CDATA[IDML (InDesign Markup Language) is an XML-based format, introduced in Adobe InDesign CS4, for representing InDesign content. IDML is used in several InDesign and InCopy file types: IDML files (or packages) are ZIP archives, containing numerous XML files. The entire &#8230; <a href="http://blogs.adobe.com/indesignsdk/2009/03/idml_file_types.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>IDML (InDesign Markup Language) is an XML-based format, introduced in Adobe InDesign CS4, for representing InDesign content.  IDML is used in several InDesign and InCopy file types:</p>
<ul>
<li>IDML files (or packages) are ZIP archives, containing numerous XML files.  The entire set of these files represent a complete InDesign document.   The files in an archive are described thoroughly in Adobe InDesign CS4 IDML File Format Specification.  IDML files are identified by the *.idml file extension.</li>
<li>Snippets are IDML-based files that describe a subset of an InDesign document.   They are not archives, but single XML files that contain IDML.  The application UI, scripting facility, and plug-in API allow you to export snippets from InDesign.  Most commonly, such a snippet represents a page item or group of page items.  These type of snippets usually are identified by the *.inds file extension.	</li>
<li>ICML (InCopy Markup Language) files are a special type of snippet.  An ICML file represent s a single InCopy story using IDML.  ICML files use the *.icml file extension. </li>
<li>InCopy assignment files are another type of IDML snippet.  They are used to allow multiple writers to work on one InDesign document.  Assignment files use the *.icma extension.</li>
<li>There are other features that leverage IDML; for example, exporting preflight profiles produces an IDML-based file.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2009/03/idml_file_types.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InDesign Flash Export with C++</title>
		<link>http://blogs.adobe.com/indesignsdk/2009/03/indesign_flash_export_with_c.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2009/03/indesign_flash_export_with_c.html#comments</comments>
		<pubDate>Mon, 02 Mar 2009 16:31:59 +0000</pubDate>
		<dc:creator>Heath Lynn</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/2009/03/indesign_flash_export_with_c.html</guid>
		<description><![CDATA[InDesign CS4 adds the ability to export pages to Flash (SWF and XFL files). The following is a 10 page InDesign CS4 document exported to SWF (Flash).&#160; You can turn the pages by clicking the text &#8220;Next&#8221;.&#160; This text was &#8230; <a href="http://blogs.adobe.com/indesignsdk/2009/03/indesign_flash_export_with_c.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>InDesign CS4 adds the ability to export pages to Flash (SWF and XFL files).</p>
<p>The following is a 10 page InDesign CS4 document exported to SWF (Flash).&#160;</p>
<p>
<object width="288" height="72"><param name="movie" value="http://blogs.adobe.com/indesignsdk/InDesign.swf" /><param name="quality" value="high" /><embed src="http://blogs.adobe.com/indesignsdk/InDesign.swf" type="application/x-shockwave-flash" width="288" height="72"></embed></object>
</p>
<p>You can turn the pages by clicking the text &#8220;Next&#8221;.&#160; This text was converted to a button in InDesign.&#160; After the first page you will also see a &#8220;Previous&#8221; button.</p>
<p>More interesting, you can use drag and drop to  turn the pages as if you&#8217;re turning the pages of of a book or a magazine.&#160; To turn the pages using drag and drop do the following:&#160;</p>
<ol>
<li>Hover the mouse cursor over the top right corner of the blue rectangle and drag it to the left.&#160; You should see the page curl.</li>
<li>Click and drag to the left.</li>
<li>Release the mouse button when the page appears close to having turned.</li>
</ol>
<p>If you need to export SWF from a plug-in,  take a look at the ExportDynamicDocument code snippet in  the InDesign CS4 Products SDK.&#160; The above SWF was exported using that code snippet.</p>
<p>Note: We added a few enhancements (XFL export, and output file selection) in the 6.0.1 update.</p>
<p>The source file lives in the following location in the InDesign CS4 Products SDK.</p>
<p>
&#160; SDK/source/sdksamples/codesnippets/SnpExportDynamicDocument.cpp</p>
<p>The code snippet does the following in C++.</p>
<ol>
<li>Creates a 10 page document.      </li>
<ul>
<li>The pages dimensions are small to create the desired SWF size.</li>
<li>At 100% scale this is 72 pixels per inch</li>
</ul>
<li>Creates two text frames on the master pages and converts them both to buttons.</li>
<li>Adds appropriate events (back and next) to these two buttons.</li>
<li>Exports to SWF or XFL.</li>
</ol>
<p>This last step demonstrates processing the kSWFExportCommandBoss and kXFLExportCommandBoss commands.</p>
<p>It&#8217;s more likely you would use  scripting to build and export SWFs.&#160; I anticipate adding an equivalent scripting sample in the near future.</p>
<div align="center">
<p>&#160;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2009/03/indesign_flash_export_with_c.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InDesign SDK Blog</title>
		<link>http://blogs.adobe.com/indesignsdk/2009/02/indesing_sdk_blog.html</link>
		<comments>http://blogs.adobe.com/indesignsdk/2009/02/indesing_sdk_blog.html#comments</comments>
		<pubDate>Wed, 18 Feb 2009 10:42:52 +0000</pubDate>
		<dc:creator>Heath Lynn</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/indesignsdk/2009/02/indesing_sdk_blog.html</guid>
		<description><![CDATA[I’m starting an InDesign SDK blog… The idea is that we will use this blog to make announcements and publish simple samples. That is my hope anyhow. I have to learn how to use the software though. So, this is &#8230; <a href="http://blogs.adobe.com/indesignsdk/2009/02/indesing_sdk_blog.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I’m starting an InDesign SDK blog…  The idea is that we will use this blog to make announcements and publish simple samples.  That is my hope anyhow.  I have to learn how to use the software though.  So, this is more or less my “Hello World” posting.</p>
<p>Thanks,</p>
<p>Heath Lynn<br />
Creative Suite Developer Technologies<br />
Adobe Systems</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/indesignsdk/2009/02/indesing_sdk_blog.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
