« Older Entries Newer Entries » Subscribe to Latest Posts

23 Apr 2010

Is Your Acrobat Plug-in Still Using ADM?

Posted by khk. Comments Off on Is Your Acrobat Plug-in Still Using ADM?


Please visit the same post on my business site. The comments are closed here, so if you want to comment, you have to head over to http://khkonsulting.com/2010/04/is-your-acrobat-plug-in-still-using-adm/

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 – everything still worked, and there wasn’t much incentive to start porting plug-ins. However, with the release of the Acrobat 9 SDK the ADM related header files were gone, but ADM based plug-ins were still working (at least some of them).

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.

As far as Adobe is concerned, ADM is no longer supported – that means there won’t be any bug fixes for it, but the plug-in has to work with Acrobat 9 on any Windows system that’s supported by Acrobat 9. So, what is a developer to do in such a situation?

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 – wxPlugin – that comes with the Acrobat SDK is based on wxWidgets. To me that was a pretty strong hint that wxWidgets would be a good choice…

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.

In order to “fix” the Mac’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:

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

Just install the libraries and include files according to the instructions provided by Adobe.

A closer inspection of the plug-in code then revealed that the part that actually did anything was commented out for the Mac with #ifndef MAC_PLATFORM statements, so I removed those and the last thing to do was to remove the reference to the libexpat library – it is provided by the operating system and does not have to be provided by wxWidgets.

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.

If your Acrobat plug-ins are still using ADM, now would be a good time to think about what to do about that… If you need any help, let me know.

23 Mar 2010

Developing Acrobat JavaScript on a MacBook

Posted by khk. 8 Comments


Please visit the same post on my business site. The comments are closed here, so if you want to comment, you have to head over to http://khkonsulting.com/2010/03/javascript-console/

Acrobat’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, …), but regardless of how a script is written, chances are that the developer wants to test parts of the script in Acrobat’s Javascript console. This console window can be shown by either using the “Advanced>Document Processing>JavaScript Debugger…” menu item or Ctrl-J on Windows or Cmd-J on a Mac:


After the console or debugger window comes up, the user can then enter Javascript and execute it…


… that is, as long as a full keyboard with a numeric keypad is used. In Adobe’s documentation, we find the following instructions to execute Javascript typed into the console window:

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:

  • 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.
  • 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.
  • To evaluate multiple lines of code, highlight those lines and press either the Enter key on the numeric keypad or press Ctrl + Enter.

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.

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 “Keyboard” category:


Make sure that the option “Show Keyboard & Character Viewer in menu bar” is selected. Once this is done, you can access the keyboard viewer from the menu bar:


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’m using code from Adobe’s Javascript API documentation:

  var menuItems = app.listMenuItems()
  for( var i in menuItems)
    console.println(menuItems[i] + "\n")

With the console prepped, bring up the keyboard viewer and start pushing keys – real keys that is: Hold down the “fn” and the “control” key, then move the mouse pointer to the “Enter” key on the keyboard viewer and click it…


… and voila, the script gets executed:


This is not the most straight forward method, but at least it’s possible to use the Javascript console to execute code when using a MacBook.

8 Mar 2010

Rye Bread

Posted by khk. 1 Comment

For a couple of years now, I’ve been looking for the perfect rye bread recipe. I know, “perfect” is a dangerous term to use, but I think I found a recipe that makes beautiful and tasty bread.

This recipe started out as Daniel Leader’s Czech Country Bread from his book Local Breads: Sourdough and Whole-Grain Recipes from Europe’s Best Artisan Bakers. I like whole grains in my bread, so I experimented with adding different kinds of whole grains – starting with replacing the white rye with whole grain rye, but eventually I ended up with replacing half of the bread flour with white whole wheat flour.

Rye Bread

150g refreshed whole grain rye sourdough starter
300g water
100g white rye flour
200g white whole wheat flour
200g unbleached bread flour
1 tsp yeast
1 1/2 tsp sea salt
1 tbsp wheat gluten
1 tbsp diastatic malt powder

Use a stand mixer to knead all the ingredients into dough (about 8-10 minutes on slow).
Cover the dough and let it rest for about two hours (or until doubled in size).
Give the dough a quick knead and form a loaf.
Cover the dough again and let rise for about 1 1/2 hours.
About one hour into the second rise place a pizza stone in oven on middle rack and a cast iron pan at the bottom of the oven and preheat to 475F.
Sprinkle whole wheat flour on a peel and place the loaf on it.
Score loaf with a very sharp knife.
Place loaf on pizza stone.
Add a cup of ice cubes into the cast iron pan close the door.
Reduce temperature to 425F.
Bake for 45 minutes.
Let the bread cool completely before cutting into it. Yes, I understand that’s hard to do, but it’s important. If you want to eat freshly baked (still hot) bread, make baguettes. There is noting better than a fresh piece of bread with some good butter.

8 Mar 2010

Even More PDF Tools

Posted by khk. 2 Comments


Please visit the same post on my business site. The comments are closed here, so if you want to comment, you have to head over to http://khkonsulting.com/2010/03/even-more-pdf-tools/

I wrote about my favorite tools around the PDF file format in the past. It’s time to add a couple more items to the list.

Over the last few months I’ve been working with two more products that I can recommend wholeheartedly:


There are a number of HTML to PDF converters available, but if your HTML is anything but basic, chances are that every single one of them does not render one or more features in your documents accurately enough… After looking at a number of them, I came across PD4ML and it looked good right from the first document I fed to it. There were a few problems, but PD4ML’s support was great in helping me out, even though I only had an evaluation license. At the end, all known problems were taken care of in the next formal release I received.

PD4ML is available as either a Java library or a .NET component. The Java JAR can actually be used as an application to get a good idea about how the generated PDF would look.

The library is available in a standard and a Pro version – there are a number of differences, which are listed in the “Products Comparison Chart” – the most important difference for me is that the Pro version supports font embedding.


As I’ve mentioned before, I’m a fan of iText (mainly because it’s Java based, and I can use it on any system that has a Java VM), but I was looking for a library that had rasterization capabilities. I found ABCpdf, and it’s a great tool that does everything I want a PDF library to do (as long as I can use .NET, ASP or VB). It can read PDF documents, modify them and write them out again, create PDF documents from scratch, convert other formats to PDF (e.g. HTML – even with FLash support, EPS, XPS, SVG). It can even use OpenOffice.org to import MS Office documents. One of the more important features for me is the ability to access low level PDF objects – either to get more information about the PDF file and it’s objects, or to make changes that are not available via other high level calls. ABCpdf also allows me to do that.

ABCpdf comes in two versions, Standard and Professional. The “PDF Component Comparison Chart” on the web site lists the differences between the two versions.

Tags: , , ,

7 Mar 2010

Latex, Pop and Dinosaurs

Posted by khk. No Comments

Have you heard? Pepsi is giving away $1,300,000 a month for great ideas “that can make a positive impact in the community”.

The money is awarded in different categories:

  • 2 Grants at the $250,000 level
  • 10 Grants at the $50,000 level
  • 10 Grants at the $25,000 level
  • 10 Grants at the $5,000 level

This is all based on votes from the public. Everybody has 10 votes a day to select worthy projects.

Rochester’s Larry Moss is competing in the $50,000 category for the ElasticPark project: The goal is to build a collection of dinosaurs out of balloons. Go to ElasticPark.com to find out more about the details – and then vote for the project!

Voting is a bit tricky: When you first go to the site, you are not logged in. The “Vote” button will only bring up the login dialog (from where you can also create a new account). Once you are logged in, your vote has not been cast yet, and you have to click on the “Vote” button again to make your vote count for the day. Vote once a day, and keep on voting until the ElasticPark project actually wins – that may be this month, next month or any time after that. As long as the project finishes within the first 100 projects, it will be automatically rolled forward to the next month.

Oh, and don’t vote for any other $50,000 project – they are all competing with ElasticPark for the same 10 top spots, but you can of course vote 9 more times every day for projects in any of the other categories.

One more thing: When you sign up for an account, make sure that you remember your password. I forgot mine, and had to use the “Reset my password” feature – it seems to reset the password for all of Pepsi, but I was not able to log into the RefreshEverything site again – I had to sign up for a second account with a different email address.

23 Feb 2010

Nuance PDF Reader

Posted by khk. Comments Off on Nuance PDF Reader


Please visit the same post on my business site. The comments are closed here, so if you want to comment, you have to head over to http://khkonsulting.com/2010/02/nuance-pdf-reader/

Nuance (the people behind OmniPage and Dragon Naturally Speaking and a bunch of other things) release a competitor to the free Adobe Reader – the free Nuance PDF Reader (http://www.nuance.com/imaging/products/pdf-reader.asp). The feature list looks very promising:

  • Fill and save PDF forms
  • Annotate PDFs
  • Convert PDF files to Word Excel or RTF
  • Can disable JavaScript
  • 100% compatibility with Adobe Acrobat (we have to wait to see how compatible it really is)
  • Supports PDF Portfolios

Now to the things that it does not do:

  • No support for Mac OS X or Linux
  • No participation in online document reviews

I’ve not spent enough time with it yet to offer a detailed review, but it’s certainly a good alternative to the Adobe Reader. Competition is a good thing, maybe Adobe will take a few cues from Nuance for their next release of Reader.

18 Feb 2010

Cat On Laptop

Posted by khk. 2 Comments

It’s been a while… My last post was a long time ago. I my defense, I’ve been working on a project, and that took up a lot of time. Now that that’s done, I may just post to my blog every now and then…

Let’s start with something simple… Cats and laptops. Here are a few pictures of my cat that I’ve taken over the last few months.

My Turn!
You don't want to use this?!?
If The Sun's Not Shining, This Has To Do...
Mmmh... Warm!

The last picture is the prelude to the next picture – a while after I took the previous picture I needed my laptop again. Here is what I found on the screen:

The Cat Selected That

Tags: , ,

30 Nov 2009

Upside Down – New Show at High Falls Art Gallery

Posted by khk. No Comments

What happens when you hang a photo upside down? Does it still work? Does it still look good? Does it turn into something different? Find out for yourself at the “Upside Down” show at the Rochester High Falls Art Gallery. One of the current shows has all frames mounted upside down.

The free public reception for the shows is on Sunday, December 6th from 3 to 6pm.

The exhibits continue through January 8th, 2009.

For more information, download the official PDF flyer.

9 Nov 2009

Converting TweetDeck Groups Into Twitter Lists – This Time for Windows As Well (Updated)

Posted by khk. 11 Comments

So, you’ve read my previous post and were bummed that the outlined procedure only worked for a Mac? I have good news for you. Here is an Adobe AIR application that can import your TweetDeck Groups into Twitter as lists:

TwitterListImporter.air [Update: See the note at the end of this post]

Download the application and install it. Because you already have TweetDeck (why else would you run this app‽‽‽) it’s not necessary to install the AIR runtime system. Once you start the application, you need to provide the path to the TweetDeck database file. The application will open the directory where you can then manually select the correct directory. In the directory that’s shown, locate a directory that starts with “TweetDeckFast” followed by a string of letters and numbers. Make sure you pick the directory, on the Mac there is also a plist file with the same name in that directory.

Once you’ve double-clicked on that directory, you will see a directory called “Local Store”, in which you will find the actual database file. It will start with “td_”, will contain your Twitter username and will end with “.db”. Select that file.

After specifying your Twitter username and password, just click on the “Convert” button and watch the show. After the application is done, you should have new Twitter lists with the members of your TweetDeck groups.

If you want to make any groups private, you need to do that on the Twitter web site.

Update – Note: When you download the file to a Windows system, the file may be named TwitterListImporter.zip instead of TwitterListImporter.air. Just rename the file. Windows is changing the extension – as far as I know, for no good reason.

31 Oct 2009

Converting TweetDeck Groups Into Twitter Lists

Posted by khk. 5 Comments

Getting your Groups out of TweetDeck… Again!

If you are a regular on Twitter, you’ve probably heard about the new feature that is currently getting rolled out to more and more users: Lists. On the surface, they look pretty much like the TweetDeck groups, but once you start digging a bit deeper, there are a number of things that you can do with lists that are not possible with groups.

Even though the TweetDeck folks have indicated that lists will be added to TweetDeck soon, I did not want to wait, to get my TweetDeck groups into Twitter lists.

I’ve written a number of posts before that explained how to extract group information from TweetDeck and other Twitter applications, we can use these techniques to extract the group members and use the Twitter API to create new list and fill these lists with users.

This time, I will do this using the Mac version of TweetDeck – mainly because every Mac comes with all the parts that are necessary to accomplish this task (Perl, sqlite3), but also because I needed it for the Mac, and just did not have time to look at a Windows based solution yet.

Getting Our Hands Dirty

Download this Perl script, copy it to your Mac and rename it to TD2TL.pl:

Then edit the file and provide your Twitter username and password – potentially you also need to modify the path to the TweetDeck database file. I’ve only tried this on a few TweetDeck installations, and it seems to work, but if things go wrong, find that file and modify that path as well.

The next step is easy: Just run the program from the command line by either making it executable, or by calling Perl with the program file on the command line:

chmod 755 ./TD2TL.pl

perl ./TD2TL.pl

While the script is running, it will report what it’s doing (e.g. creating a list, or adding users to a list). Once it’s done, you will have these groups available as Twitter lists – without the hassle to go through all your 1000 followed Tweeters and manually assign them to lists.