Posted by: Peter Quirk | May 14, 2008

Pursuing a solution for printing a notecard in realXtend

I have a list of things I consider essential functionality for a knowledge worker in a virtual world like Second Life or realXtend. One of the items on the top of the list is printing a notecard. The lack of printing functionality was reported a year ago in the Linden Lab JIRA database (VWR-391), but it has been a low priority bug because there is a workaround – copy all the text on the notecard, paste it into your favorite text editor outside Second Life and print it from there. It’s about as clunky as the machine below.


Extending the Second Life client to add printing functionality in the inventory GUI is a bit beyond me, but I thought I might be able to extend the realXtend server using its Python scripting extensions. For the last few evenings I’ve been exploring the issues. Here are some of the things I’ve run up against so far:

  • realXtend is a scripting host for IronPython. The version of IronPython is not listed anywhere, but an examination of the DLLs shows that it is ver That means it has some equivalency with Python 2.4.3. I filed a bug report with realXtend team to document the IronPython version number in release notes.
  • Knowing that realXtend supports the Python 2.4 functionality we can search for modules that might be compatible. Pywin32 is available in different flavors including 2.4 and supports shell commands, so we might be able to start a shell to print a formatted text file containing content copied from a notecard.
  • IronPython as hosted in realXtend lacks the site-packages directory, so I’m not sure how to install the modules. Furthermore, the installation process requires a working Python, so I think I have to install Python 2.4 and install the modules in its site-packages folder. The IronPython implementation includes a script which can be modified to add other directories to the site path. (I still have to work out whether you can set IRONPYTHONPATH  to refer to the additional libraries.)There’s actually a lot more to learn about installing packages. It seems there is an enhanced distribution of IronPython called FePy which includes the functionality of the site-packages folder and the standard package installation procedures. Whether there’s any way to replace the hosted IronPython with this by switching an re-registering DLLs is another exercise!
  • Further reading suggests that pywin32 may not work in IronPython anyway, so I may need a backup plan using the .NET features of IronPython. Again, I could fire up a shell, but I might as well learn something about the XPS printing model. (Update 5/16: Pywin32 doesn’t work with IronPython 1.1.1 because it includes compiled C/C++ routines.)
  • The XPS FlowDocument is well-matched to the simple notecard. It should be relatively easy for a Python script to iterate over the lines of a notecard and wrap the XML markup of a FlowDocument around the lines or paragraphs.
  • I still have to understand and test how to initiate the printing of the XPS document on the server and direct the output to the default printer on my client, which is always a networked device (even at home).
  • Last, and by no means least, I have to define an appropriate user interface. I’m leaning towards the idea of a realistic looking printer which I can rez from inventory wherever I am. It has a pie menu which lets me set which network printer I want to print to. In a later phase I would add portrait/landscape selection to the menu. To print a notecard, I would simply drag it from inventory to the printer.

I’m hoping that the approach described above gets around the limited functionality of LSL scripting, including restrictions on how much data can be moved over HTTP and XMLRPC connections, and in which direction it can go.

If you know of a better solution, please let me know. If anyone feels inspired to fix VWR-391 soon, that would be good too!



  1. Hi… I just spotted this blog and just had to comment.

    I am the guy who reported this sugesstion on Jira so I obviously want that function. I had given up hope of ever seeing it get anywhere.

    Glad to see your taking an interest in it.. good luck.

    I too use Realxtend viewer. I use it on my own Opensim grid especially as it now allows (in Opensim grids)100m prims. I have just this week suggested to Realxtend that they up this to 128m (binary world binary limits) and to allow prim hollow up to 99%. Did I get a “cant do” like I got from LL. No … I got a “good idea.. well try to get it in on the next release (due out in 4 days time)”. I cant believe the difference in attitude.

    A thought… why not drop Jani Prikola at Realxtend an email telling him what you are planning and see if he can make life easier for you. He seems a real helpful guy.

  2. Thanks Bob! I will follow up with Jani – good idea!
    — Peter

  3. Hi Peter… Did you have any luck with Jani?

  4. […] JPEG2000, LSL, Mono, notecards, OpenSim, PowerPoint, realXtend, Second Life |   In an earlier post I lamented the lack of printing support for notecards in Second Life. Bob Wellman commented that he […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: