<?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>Karl Heinz Kremer&#039;s Ramblings &#187; development</title>
	<atom:link href="http://www.khk.net/wordpress/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.khk.net/wordpress</link>
	<description>Stuff, stuff and more stuff</description>
	<lastBuildDate>Sun, 25 Sep 2011 18:38:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Is Your Acrobat Plug-in Still Using ADM?</title>
		<link>http://www.khk.net/wordpress/2010/04/23/is-your-acrobat-plug-in-still-using-adm/</link>
		<comments>http://www.khk.net/wordpress/2010/04/23/is-your-acrobat-plug-in-still-using-adm/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 16:33:08 +0000</pubDate>
		<dc:creator>khk</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[adm]]></category>
		<category><![CDATA[adobe pdf]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[wxwidgets]]></category>

		<guid isPermaLink="false">http://www.khk.net/wordpress/?p=617</guid>
		<description><![CDATA[For a few years now Adobe has been telling 3rd party developers that the ADM (Adobe Dialog Manager) will be discontinued, and that existing plug-ins may have to be ported to something else. If I remember correctly, this started with Acrobat 7 or 8, but back then it was a soft threat &#8211; everything still [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.khk.net%2Fwordpress%2F2010%2F04%2F23%2Fis-your-acrobat-plug-in-still-using-adm%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.khk.net%2Fwordpress%2F2010%2F04%2F23%2Fis-your-acrobat-plug-in-still-using-adm%2F&amp;source=khkremer&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>For a few years now Adobe has been telling 3rd party developers that the ADM (Adobe Dialog Manager) will be discontinued, and that existing plug-ins may have to be ported to something else. If I remember correctly, this started with Acrobat 7 or 8, but back then it was a soft threat &#8211; everything still worked, and there wasn&#8217;t much incentive to start porting plug-ins. However, with the release of the <a href="http://www.adobe.com/devnet/acrobat">Acrobat 9 SDK</a> the ADM related header files were gone, but ADM based plug-ins were still working (at least some of them). </p>
<p>The removal of the header files does send a strong signal, but what was an even stronger signal for me was that one of the ADM based plug-in I was working on was no longer working correctly on some versions of Windows. </p>
<p>As far as Adobe is concerned, ADM is no longer supported &#8211; that means there won&#8217;t be any bug fixes for it, but the plug-in has to work with Acrobat 9 on any Windows system that&#8217;s supported by Acrobat 9. So, what is a developer to do in such a situation?</p>
<p>Adobe does not give us much guidance in what to chose as a replacement for ADM. The most obvious choice is to stick with the native UI framework that comes with the operating system, but the advantage of ADM was that one could write UI code that would run in both Windows and Mac plug-ins. One of the sample plug-ins &#8211; wxPlugin &#8211; that comes with the Acrobat SDK is based on <a href="http://wxwidgets.org/">wxWidgets</a>. To me that was a pretty strong hint that wxWidgets would be a good choice&#8230;</p>
<p>However, even though the Mac version of the SDK does come with the wxPlugin code and even contains a XCode project file, it does not compile. After some work, trying to come up with a combination of wxWidget configuration options and wxPlugin project settings, I was able to create an Acrobat plug-in that worked. </p>
<p>In order to &#8220;fix&#8221; the Mac&#8217;s version of the wxPlugin I first had to compile wxWidgets. Use the following configure command line to create the static wxWidget libraries that can be linked with the project:</p>
<p><pre><code>configure CC=gcc-4.0 CXX=g++-4.0 LD=g++-4.0 --enable-universal_binary \
--disable-shared --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk \
--with-mmacosx-version-min=10.4 --enable-debug</code></pre></p>
<p>Just install the libraries and include files according to the <a href="http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/API_References/Acr obat_API_Reference/Samples/CodeSamples/sample-descriptions.html">instructions provided by Adobe</a>. </p>
<p>A closer inspection of the plug-in code then revealed that the part that actually did anything was commented out for the Mac with <code>#ifndef MAC_PLATFORM</code> statements, so I removed those and the last thing to do was to remove the reference to the <code>libexpat</code> library &#8211; it is provided by the operating system and does not have to be provided by wxWidgets.</p>
<p>With a working environment on the Mac, wxWidgets is a viable alternative for ADM for either new Acrobat plug-ins, or existing plug-ins that need to be modified to make them compatible with the current version of Acrobat. </p>
<p>If your Acrobat plug-ins are still using ADM, now would be a good time to think about what to do about that&#8230; If you need any help, <a href="mailto:khk+b1GvaE@khk.net">let me know</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.khk.net/wordpress/2010/04/23/is-your-acrobat-plug-in-still-using-adm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing Acrobat JavaScript on a MacBook</title>
		<link>http://www.khk.net/wordpress/2010/03/23/javascript-console/</link>
		<comments>http://www.khk.net/wordpress/2010/03/23/javascript-console/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 17:58:20 +0000</pubDate>
		<dc:creator>khk</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[adobe pdf]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.khk.net/wordpress/?p=624</guid>
		<description><![CDATA[Acrobat&#8217;s JavaScript is a great tool to extend the application, or to automate reoccurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts, &#8230;), but regardless of how a script is written, chances are that the developer wants to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.khk.net%2Fwordpress%2F2010%2F03%2F23%2Fjavascript-console%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.khk.net%2Fwordpress%2F2010%2F03%2F23%2Fjavascript-console%2F&amp;source=khkremer&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Acrobat&#8217;s JavaScript is a great tool to extend the application, or to automate reoccurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts, &#8230;), but regardless of how a script is written, chances are that the developer wants to test parts of the script in Acrobat&#8217;s Javascript console. This console window can be shown by either using the &#8220;Advanced>Document Processing>JavaScript Debugger&#8230;&#8221; menu item or Ctrl-J on Windows or Cmd-J on a Mac:</p>
<div style="text-align:center;"><img src="http://www.khk.net/wordpress/wp-content/uploads/2010/03/BlogPicsJS_Menu.png" alt="JS_Menu.png" border="0" width="400" /></div>
<p>After the console or debugger window comes up, the user can then enter Javascript and execute it&#8230; </p>
<div style="text-align:center;"><img src="http://www.khk.net/wordpress/wp-content/uploads/2010/03/BlogPicsJS_Debugger.png" alt="JS_Debugger.png" border="0" width="500" /></div>
<p>&#8230; that is, as long as a full keyboard with a numeric keypad is used. In Adobe&#8217;s documentation, we find the following <a href="http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_Dev_Tools.72.4.html">instructions to execute Javascript typed into the console window</a>:</p>
<p>
The JavaScript console allows you to evaluate single or multiple lines of code. There are three ways to evaluate JavaScript code while using the interactive console:</p>
<ul>
<li>To evaluate a portion of a line of code, highlight the portion and press either the Enter key on the numeric keypad or press Ctrl + Enter.</li>
<li>To evaluate a single line of code, make sure the cursor is positioned on that line and press either the Enter key on the numeric keypad or press Ctrl + Enter.</li>
<li>To evaluate multiple lines of code, highlight those lines and press either the Enter key on the numeric keypad or press Ctrl + Enter.</li>
</ul>
<p>That works fine as long as you have access to the numeric keypad, but on a MacBook or a MacBook Pro without that keypad. No key combination involving fn, ctrl, cmd or option with the Return or Enter key will result in the Javascript getting executed. </p>
<p>The virtual keyboard to the rescue: Mac OS comes with a handy keyboard viewer that allows us to send the correct key code to the application. To bring up the keyboard viewer, bring up the Mac OS System Preferences first and select the &#8220;Keyboard&#8221; category:</p>
<div style="text-align:center;"><img src="http://www.khk.net/wordpress/wp-content/uploads/2010/03/BlogPicsKeyboardViewer_1.png" alt="KeyboardViewer_1.png" border="0" width="500" /></div>
<p>Make sure that the option &#8220;Show Keyboard &#038; Character Viewer in menu bar&#8221; is selected. Once this is done, you can access the keyboard viewer from the menu bar:</p>
<div style="text-align:center;"><img src="http://www.khk.net/wordpress/wp-content/uploads/2010/03/BlogPicsKeyboardViewer_2.png" alt="KeyboardViewer_2.png" border="0" width="244" height="118" /></div>
<p>Now comes the tricky part: Write some Javascript in the console window and place the cursor on the line you want to execute or select the snippet of the Javascript that should be executed. In the following example I&#8217;m using code from <a href="http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.151.html">Adobe&#8217;s Javascript API documentation</a>:</p>
<p><pre><pre>
&nbsp;&nbsp;var menuItems = app.listMenuItems()
&nbsp;&nbsp;for( var i in menuItems)
&nbsp;&nbsp;&nbsp;&nbsp;console.println(menuItems[i] + &quot;\n&quot;)
</pre></pre></p>
<p>With the console prepped, bring up the keyboard viewer and start pushing keys &#8211; real keys that is: Hold down the &#8220;fn&#8221; and the &#8220;control&#8221; key, then move the mouse pointer to the &#8220;Enter&#8221; key on the keyboard viewer and click it&#8230;</p>
<div style="text-align:center;"><img src="http://www.khk.net/wordpress/wp-content/uploads/2010/03/BlogPicsJS_Debugger_6.png" alt="JS_Debugger_6.png" border="0" width="500" /></div>
<p>&#8230; and voila, the script gets executed:</p>
<div style="text-align:center;"><img src="http://www.khk.net/wordpress/wp-content/uploads/2010/03/BlogPicsJS_Debugger_7.png" alt="JS_Debugger_7.png" border="0" width="500"/></div>
<p>This is not the most straight forward method, but at least it&#8217;s possible to use the Javascript console to execute code when using a MacBook. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.khk.net/wordpress/2010/03/23/javascript-console/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

