<?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; Adobe Acrobat</title>
	<atom:link href="http://www.khk.net/wordpress/tag/adobe-acrobat/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.khk.net/wordpress</link>
	<description>Stuff, stuff and more stuff</description>
	<lastBuildDate>Mon, 07 Jun 2010 13:25:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Teaching Adobe Reader a Few New Tricks</title>
		<link>http://www.khk.net/wordpress/2009/06/20/adobe-reader-enable-rights/</link>
		<comments>http://www.khk.net/wordpress/2009/06/20/adobe-reader-enable-rights/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 13:00:10 +0000</pubDate>
		<dc:creator>khk</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[acrobat.com]]></category>
		<category><![CDATA[Adobe Acrobat]]></category>
		<category><![CDATA[adobe reader]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[rights enabled]]></category>

		<guid isPermaLink="false">http://khk.net/wordpress/?p=455</guid>
		<description><![CDATA[
			
				
			
		
Have you ever tried to fill a PDF form in Adobe Reader and to then save that filed document to your hard disk? Did it work? Chances are that it did not.
Have you ever thought about why the Adobe Reader is called &#8220;Reader&#8221;? The answer is pretty obvious, it&#8217;s because it is only reading and [...]]]></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%2F2009%2F06%2F20%2Fadobe-reader-enable-rights%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.khk.net%2Fwordpress%2F2009%2F06%2F20%2Fadobe-reader-enable-rights%2F&amp;source=khkremer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Have you ever tried to fill a PDF form in Adobe Reader and to then save that filed document to your hard disk? Did it work? Chances are that it did not.</p>
<p>Have you ever thought about why the Adobe Reader is called &#8220;Reader&#8221;? The answer is pretty obvious, it&#8217;s because it is only reading and displaying (and printing) PDF files &#8211; that is, it is not writing them. That also includes that it will not save a modified document. You would need the &#8220;Adobe Writer&#8221; &#8211; or &#8220;Adobe Acrobat&#8221; as it is called for that.</p>
<p>But regardless of the name, we can &#8220;trick&#8221; the Reader into writing a filled form to the disk. OK, it&#8217;s not really a trick, Adobe did implement this feature, so it&#8217;s official, and we are not hacking or cracking anything.</p>
<p><span id="more-455"></span>Adobe has a server based solution that does allow you to create PDF files that are &#8220;reader enabled&#8221;: <a href="http://www.adobe.com/products/livecycle/readerextensions/">Adobe LiveCycle Reader Extensions ES</a><br />
That technology allows you to &#8220;Fill in, sign, comment on, or save Adobe PDF files using only Adobe Reader&#8221;. Sounds like the perfect solution. Let me tell you a little secret: Whenever you hear the terms &#8220;Adobe&#8221; and &#8220;Server&#8221; in the same sentence, it usually means expensive&#8230;</p>
<p>Here is another secret &#8211; not really, it&#8217;s documented in a lot of places, but Acrobat users often don&#8217;t know about it: You can use Adobe Acrobat to &#8220;reader enable&#8221; PDF files as well. However, when you agreed to the EULA during the installation of Acrobat, you also agreed to using this technology only for a form with a maximum of 500 copies. The reason for that is of course, that Adobe still wants to sell the server based solution for document workflows that involve more copies.</p>
<p>So, let&#8217;s take a look at the EULA and find out exactly what we agreed to:</p>
<p>&#8220;15.12.3 For any unique Extended Document, you may only either (a) Deploy such Extended Document to an unlimited number of unique recipients but shall not extract information from more than five hundred (500) unique instances of such Extended Document or any hardcopy representation of such Extended Document containing filled form fields; or (b) Deploy such Extended Document to no more than five hundred (500) unique recipients without limits on the number of times you may extract information from such Extended Document returned to you filled-in by such Recipients. Notwithstanding anything herein to the contrary, obtaining additional licenses to use Acrobat Pro or Acrobat Pro Extended shall not increase the foregoing limits (that is, the foregoing limits are the aggregate total limits regardless of how many additional licenses to use Acrobat Pro or Acrobat Pro Extended you may have obtained). &#8220;</p>
<p>You may want to review that with your lawyer, I&#8217;m just an engineer, and in no position to give legal advice. I&#8217;ll however let you know what my interpretation of that section is: We have two options, we can either distribute our enabled form to an unlimited number of users, but we can only process a maximum of 500 unique responses. So, if we distribute our form to 1000 recipients, and we get 500 copies back, we are good. If we receive 501 replies, we can process the first 500, but the last one we cannot even look at. It also does not matter if we receive the filled out forms via a printed sheet of paper, or electronically. The second option is a bit more complicated, and you really should talk to your lawyer about that. To me it seems that you can distribute 500 copies of your form to 500 unique recipients, and they can then submit that form as often as they want. This could e.g. be a form that needs to be submitted once a week. Every one of your (up to 500) users/customers/clients has a copy of that form, and then once a week they fill in new data and submit the form.</p>
<p>Now we know what we can do with these forms, but we still don&#8217;t know how to use Acrobat for that. Let me show you a few screen shots.</p>
<p>Let&#8217;s assume you have a PDF form that you want to distribute, open that file in Acrobat and select &#8220;Forms&gt;Distribute Form&#8221;:</p>
<div style="text-align:center;"><img src="http://khk.net/wordpress/wp-content/uploads/2009/06/distributeformmenu.png" border="0" alt="DistributeFormMenu.png" width="288" height="246" /></div>
<p>This will bring up the dialog that we need to work with for the next few steps:</p>
<div style="text-align:center;"><img src="http://khk.net/wordpress/wp-content/uploads/2009/06/distributeformdialog.png" border="0" alt="DistributeFormDialog.png" width="400"  /></div>
<p>As you can see, I&#8217;ve selected to manually collect the responses in my email. That&#8217;s the most straight forward option and does not require any other configuration. The information presented below the selection does give you a pretty good idea about what it is. For now, let&#8217;s stick with the email option, but please, play around with the other options and let me know if you run into problems.</p>
<p>In the next step we specify the target location on our local hard disk for the protected (and now reader-enabled) copy of our file:</p>
<div style="text-align:center;"><img src="http://khk.net/wordpress/wp-content/uploads/2009/06/distributeformdialogfile.png" border="0" alt="DistributeFormDialogFile.png" width="400"  /></div>
<p>Now we need to add some information about us, the author:</p>
<div style="text-align:center;"><img src="http://khk.net/wordpress/wp-content/uploads/2009/06/distributeformdialoginfo.png" border="0" alt="DistributeFormDialogInfo.png" width="400"  /></div>
<p>We get one more chance to revise our decision about the delivery method, so if you want to take a different approach, and use <a title="Adobe's online Acrobat.com service" href="http://acrobat.com">Acrobat.com</a> to collect the returned forms, here is your last chance. I will stick with the email option:</p>
<div style="text-align:center;"><img src="http://khk.net/wordpress/wp-content/uploads/2009/06/distributeformdialogdelivery.png" border="0" alt="DistributeFormDialogDelivery.png" width="400"  /></div>
<p>Once we click on the &#8220;Finish&#8221; button, the form will be prepared and saved, and Acrobat will display the Tracker interface. That dialog can also be opened via the &#8220;Forms&gt;Track Forms&#8221; menu item (see the menu screen shot from above). I will talk more about that in a future post.</p>
<div style="text-align:center;"><img src="http://khk.net/wordpress/wp-content/uploads/2009/06/distributeformtracker.png" border="0" alt="DistributeFormTracker.png" width="400"  /></div>
<p>All you have to do now is to distribute your form. In a future post I will talk about how to process the returned data.</p>
<p>If allowing your users to locally save a form, you are done. They now can partially fill a form, save it, open it at a later time and continue with the form.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khk.net/wordpress/2009/06/20/adobe-reader-enable-rights/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Acrobat, JavaScript and VB walk into a bar&#8230;</title>
		<link>http://www.khk.net/wordpress/2009/03/11/acrobat-javascript-and-vb-walk-into-a-bar/</link>
		<comments>http://www.khk.net/wordpress/2009/03/11/acrobat-javascript-and-vb-walk-into-a-bar/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 00:37:36 +0000</pubDate>
		<dc:creator>khk</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Acrobat SDK]]></category>
		<category><![CDATA[Adobe Acrobat]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://khk.net/wordpress/?p=256</guid>
		<description><![CDATA[
			
				
			
		
OK, let&#8217;s just forget about that old joke and concentrate on how to combine all three into something that is quite useful.
As I&#8217;ve described in one of my previous posting, it is quite easy to automate Acrobat from VB or VBA. So how does JavaScript fit into this picture? As you may know, Acrobat comes [...]]]></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%2F2009%2F03%2F11%2Facrobat-javascript-and-vb-walk-into-a-bar%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.khk.net%2Fwordpress%2F2009%2F03%2F11%2Facrobat-javascript-and-vb-walk-into-a-bar%2F&amp;source=khkremer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>OK, let&#8217;s just forget about that old joke and concentrate on how to combine all three into something that is quite useful.</p>
<p>As I&#8217;ve described in one of my <a href="http://khk.net/wordpress/2009/03/04/adobe-acrobat-and-vba-an-introduction/">previous posting</a>, it is quite easy to automate Acrobat from VB or VBA. So how does JavaScript fit into this picture? As you may know, Acrobat comes with a very powerful JavaScript engine that provides access to a lot of functionality &#8211; more functions actually than what you have access to from your VB program. So, if you want to access some of these features, but you are stuck with VB, how can you do that?</p>
<p>Adobe provides a VB/JavaScript bridge with Acrobat &#8211; the JSObject, and the <a href="http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/IAC_DevApp_OLE_Support.100.13.html">Acrobat SDK describes how to use that feature</a>.</p>
<p>There is quite a bit of good information in the documentation. When you access the online documentation, expand the tree to &#8220;Acrobat Interapplication Communication > Developing Applications Using Interapplication Communication > Using OLE > Using the JSObject interface&#8221;.</p>
<p><H3>JavaScript</H3></p>
<p>In this example, I want to illustrate how you can create a folder level JavaScript function, instantiate the JSObject, and then call the custom function and display the result in VB. My plan was to use the <a href="http://khk.net/wordpress/2009/03/11/counting-bookmarks/">JavaScript code from my last posting</a>, but I found one small problem in the way I wrote the code (it works fine as a standalone JavaScript program, but we cannot use it in the VB context), so here is it&#8217;s replacement:</p>
<p><pre><pre>
function CountBookmarks(bkm, nLevel)
{
&nbsp;&nbsp;&nbsp;&nbsp;var count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;if (bkm.children != null)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = bkm.children.length;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (var i = 0; i &lt; bkm.children.length; i++)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count += CountBookmarks(bkm.children[i], nLevel + 1);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;return count;
}

function CountAllBookmarks()
{
&nbsp;&nbsp;&nbsp;&nbsp;console.clear(); console.show();
&nbsp;&nbsp;&nbsp;&nbsp;var n = CountBookmarks(this.bookmarkRoot, 0);
&nbsp;&nbsp;&nbsp;&nbsp;console.println(&quot;Number of bookmarks found: &quot; + n);

&nbsp;&nbsp;&nbsp;&nbsp;return n;
}

// add the menu item
app.addMenuItem({
&nbsp;&nbsp;&nbsp;&nbsp; cName: &quot;countBookmarks&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cUser: &quot;Count Bookmarks&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cParent: &quot;Document&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cExec: &quot;CountAllBookmarks();&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cEnable: &quot;event.rc = (event.target != null);&quot;
});

</pre></pre> </p>
<p>Save this JavaScript program as a folder level JavaScript file and make sure that it works.</p>
<p>So, why can&#8217;t we just implement the whole algorithm with the JSObject? The problem is with how VB handles objects that are actually JavaScript objects &#8211; in this case the root bookmark object. I cannot figure out how to access it&#8217;s &#8220;children&#8221; property through the JSObject. That&#8217;s the reason why I&#8217;m &#8220;cheating&#8221; by calling our custom JavaScript function &#8211; being able to do that is pretty cool IMHO.</p>
<p><H3>The VB Part</H3></p>
<p>We start out just like with any other VB program, by declaring some objects, initializing them and then it gets interesting&#8230;</p>
<p>Here is some sample code that shows how to initialize the JSObject, and how to call our own JavaScript function.  </p>
<p>Create a button on an Excel spreadsheet again, and put the following code into the button handler callback (just like before). </p>
<p><pre><pre>
Dim gApp As Acrobat.CAcroApp
Dim gPDDoc As Acrobat.CAcroPDDoc
Dim jso As Object

Sub Button1_Click()
&nbsp;&nbsp;&nbsp;&nbsp;Set gApp = CreateObject(&quot;AcroExch.App&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;Set gPDDoc = CreateObject(&quot;AcroExch.PDDoc&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;If gPDDoc.Open(&quot;c:\temp\test.pdf&quot;) Then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set jso = gPDDoc.GetJSObject
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox (jso.CountAllBookmarks())
&nbsp;&nbsp;&nbsp;&nbsp;End If
End Sub
</pre></pre></p>
<p>Now just make sure that you have a file c:\temp\test.pdf that has some bookmarks in it. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.khk.net/wordpress/2009/03/11/acrobat-javascript-and-vb-walk-into-a-bar/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Counting Bookmarks</title>
		<link>http://www.khk.net/wordpress/2009/03/11/counting-bookmarks/</link>
		<comments>http://www.khk.net/wordpress/2009/03/11/counting-bookmarks/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 00:17:42 +0000</pubDate>
		<dc:creator>khk</dc:creator>
				<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Adobe Acrobat]]></category>

		<guid isPermaLink="false">http://khk.net/wordpress/?p=251</guid>
		<description><![CDATA[
			
				
			
		
Let&#8217;s assume you have a PDF document, and you want to know how many bookmarks you have in that document, how would you approach that? 
The JavaScript API has methods to traverse the bookmark tree. Here is a short program that &#8211; once installed in Acrobat&#8217;s JavaScript folder &#8211; will add a menu item &#8220;Count [...]]]></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%2F2009%2F03%2F11%2Fcounting-bookmarks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.khk.net%2Fwordpress%2F2009%2F03%2F11%2Fcounting-bookmarks%2F&amp;source=khkremer&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Let&#8217;s assume you have a PDF document, and you want to know how many bookmarks you have in that document, how would you approach that? </p>
<p>The JavaScript API has methods to traverse the bookmark tree. Here is a short program that &#8211; once installed in Acrobat&#8217;s JavaScript folder &#8211; will add a menu item &#8220;Count Bookmarks&#8221; to the &#8220;Document&#8221; menu, and when executed will print the number of bookmarks encountered in the JavaScript console.</p>
<p><pre><pre>
function CountBookmarks(bkm, nLevel)
{
&nbsp;&nbsp;&nbsp;&nbsp;var count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;if (bkm.children != null)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = bkm.children.length;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (var i = 0; i &lt; bkm.children.length; i++)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count += CountBookmarks(bkm.children[i], nLevel + 1);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;return count;
}

function DoIt()
{
&nbsp;&nbsp;&nbsp;&nbsp;console.clear(); console.show();
&nbsp;&nbsp;&nbsp;&nbsp;var n = CountBookmarks(this.bookmarkRoot, 0);
&nbsp;&nbsp;&nbsp;&nbsp;console.println(&quot;Number of bookmarks found: &quot; + n);
}

// add the menu item
app.addMenuItem({
&nbsp;&nbsp;&nbsp;&nbsp; cName: &quot;countBookmarks&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cUser: &quot;Count Bookmarks&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cParent: &quot;Document&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cExec: &quot;DoIt();&quot;,
&nbsp;&nbsp;&nbsp;&nbsp; cEnable: &quot;event.rc = (event.target != null);&quot;
});

</pre></pre></p>
<p>Save this program in a file in e.g. C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts (for Acrobat 9) and restart Acrobat. You should now find a new menu item in the Document menu. Load a file with bookmarks in it, and execute the menu item. </p>
<p>I have not implemented the privileged execution context that is required to make this work in all instances, so you  have to go into your JavaScript preferences in Acrobat and check the setting for &#8220;Enable menu items JavaScript execution privileges&#8221;:</p>
<div style="text-align:center;"><img src="http://khk.net/wordpress/wp-content/uploads/2009/03/preferencesjavascript.png" alt="PreferencesJavaScript.png" border="0" width="300" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.khk.net/wordpress/2009/03/11/counting-bookmarks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
