Archive for the ‘Uncategorized’ Category

Where to Find the Adobe Lightroom SDK Docs

Monday, August 30th, 2010

I have a bad history with finding Adobe documentation.  I know they have docs, I just can’t seem to enter the correct search terms to find what I need.

I was looking for documentation on how to implement your own web template in Adobe Photoshop lightroom, and it turns out the key term for this is “webengine”.

… I guess that makes sense.  At any rate, if you are looking to implement a plugin in Lightroom that generates a customized web gallery, you need the Lightroom SDK Documentation.

Adobe XFDF

Monday, October 20th, 2008

Adobe Xml Forms Data Format is an xml format that allows you to fill PDF forms.  I used this in my D&D character generator to allow for easy creation of a printable character sheet in PDF form.
I started with an editable PDF form.  Each field in an editable form has a name of some sort, and if you have access to Adobe LiveCycle Designer, you can view the fields as XML.  All you have to do is open the editable PDF in LiveCycle Designer and click View->XML Source.  This will give you a long XML list detailing all the fields in your form.
UPDATE 2008-11-13: I got an email from someone recently who was creating his editable form using LiveCycle Designer.  It turns out that if you use LiveCycle Designer to build your form, it won’t work with XFDF.  If you want to use XFDF, you have to create the form using Acrobat.  LiveCycle Designer forms require that you use XDP (which I have never used).  You can read a bit more about the incompatibilities here.
To specify the values to go into an editable PDF, you create an XFDF file.  The basic format is this:
<?xml version=”1.0″ encoding=”UTF-8″?>
<xfdf xmlns=”http://ns.adobe.com/xfdf/” xml:space=”preserve”>
<f href=”http://www.lukerymarz.com/files/CharacterSheet.pdf”/>
<fields>
  <field name=”name”>
    <value>null</value>
  </field>
  <field name=”level”>
    <value>1</value>
  </field>
  <field name=”class”>
    <value>Warlock</value>
  </field>
  <field name=”race”>
    <value>Tiefling</value>
  </field>
   …
   …
   …
</fields>
</xfdf>
You put this in a text file with an xfdf extension and when you open it, it will reference the pdf in the <f> field and fill in the specified fields.  
So how do you get from the XML LiveCycle Designer gives you to the actual xfdf data.  Well, I didn’t want to type a bunch of repetitive lines for each field in the form, so I wrote a little tool to take the LiveCycle xml and spit out ActionScript.  My tool opens the LiveCycle XML, parses each field, and provides a listing with the field type.  It then converts each field to ActionScript code that will append to a string in a my output function.  All I did then was copy the ActionScript code, fill in the specific piece of data for each field (for example, currentCharacter.name for the “name” field), and the output was done.  
There are two caveats I ran into, and the first has to do with spaces.  For each field, the name of that field in the LiveCycle XML has an underscore where a space is.  In the XFDF XML you generate, those underscores need to be replaced with an actual space, otherwise your field won’t get filled in.  
The second caveat has to do with arrays.  For example, a part of the ActionScript code my tool generated looks like this:
xfdf += ‘<field name=”class_feature.0″><value>’ + Database.Data.currentCharacter. + ‘</value></field>’;
xfdf += ‘<field name=”class_feature.1″><value>’ + Database.Data.currentCharacter. + ‘</value></field>’;
xfdf += ‘<field name=”class_feature.2″><value>’ + Database.Data.currentCharacter. + ‘</value></field>’;
xfdf += ‘<field name=”class_feature.3″><value>’ + Database.Data.currentCharacter. + ‘</value></field>’;
xfdf += ‘<field name=”class_feature.4″><value>’ + Database.Data.currentCharacter. + ‘</value></field>’;
xfdf += ‘<field name=”class_feature.5″><value>’ + Database.Data.currentCharacter. + ‘</value></field>’;
xfdf += ‘<field name=”class_feature.6″><value>’ + Database.Data.currentCharacter. + ‘</value></field>’;
This is an array of class features.  You’d think you could just go through the list, creating:
  <field name=”class feature.0″>
    <value>sample feature 1</value>
  </field>
  <field name=”class feature.1″>
    <value>sample feature 2</value>
  </field>
But that is incorrect.  Since this is an array, you have to represent it as one in the xfdf.  The actual output would look like this:
  <field name=”class feature”>
    <field name=”0″>
      <value>Eldritch Blast:</value>
    </field>
    <field name=”1″>
      <value>Edlritch Pact: Choose Fey Pact, Infernal Pact, or Star Pact.</value>
    </field>
    <field name=”2″>
      <value>Prime Shot: If you are closest to your target, +1 to attack rolls</value>
    </field>
  </field>
And that’s it.  If you reference a pdf on a website, you can send only the xfdf to your user, and as long as they have access to your website, when they open the xfdf, Adobe will take care of the rest.  Pretty neat, once you get past the catches.

On Other Projects

Friday, May 16th, 2008

I haven’t made a post in the last two weeks because I’ve been working on another top secret project. I’m guessing it will take another two weeks of my time, and then I’ll start posting some more stuff here. ‘Til then…

Quick Update

Tuesday, March 11th, 2008

I haven’t posted my menu system yet because I’ve been working on some programming problems “someone” asked me to work on ;). I also moved into my new place this weekend, so I’ve been extra busy. I hope to be done with these top secret programming problems by tonight. Hopefully I’ll be able to post some code for my menu system by the end of the week.

I was looking at some other XNA code yesterday, and I think I need to look into spriteFonts. I might be able to use those instead of the bitmap font class I’m using now. spriteFonts are built in to XNA, so they might be faster. I’ll have an easier time modifying the font type, that’s for sure. More later this week…

Some Changes and Updates

Monday, March 3rd, 2008

I’ve just changed my blog size to be a little wider. I was getting tired of my code being all squished. Also, I’m using the Visual Studio 2005 add-in CopySourceAsHtml to display code in my posts. After getting it set up, you can just copy and paste right into the blogger post editor.

Catching Up

Wednesday, February 27th, 2008

I should have started this blog a while ago, because it helps your brain remember things if you flesh it out on paper.

I recently went through a tutorial called The Wizard. I think i can safely say that I didn’t like it. The design of the project starts out nicely. You’ve got your game, which has a wizard, which extends the Sprite class. Got it. They even go into spritesheets, of which the implementation details are new and useful to me. They talk about game states, and they are required for game design.

The code after that is… poor. What you end up with is a sprite you can move around on the screen, but which can only respond to a single command at a time. It’s like those old games, like Dragon Warrior, where you’d press a button and the character would move, during which you couldn’t do anything else. I don’t think any new code should result in something like that. Even the most basic tutorials on the XNA site don’t result in something like that. Then again, i bet this type of implementation would work well for a board game.

My First Post

Wednesday, February 27th, 2008

Welcome to Luke Rymarz’s blog. It’s pretty boring here right now, but I’ll have some more stuff later this week. My plan for this blog is to recount things I’ve learned in my software engineering career, so I can better lock them into my brain.

Hello world!

Monday, August 13th, 2007

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!