Monday, June 1, 2009

Convert PDF to Word on OS X and Linux

(or, why online services matter)

Once in a while we get customers that ask when we're going to port our software to OS X so that they can use them on their shiny new Mac desktop or notebook (a few people ask for Linux support as well, although they are few and far between).

The answers we've given over the years typically amounts to "Porting them would take a lot of work and we don't know if we could recoup the cost".

Over the years a number of "good" workarounds have come up. On Macs both Boot Camp and Virtualization software work well, if you're willing to spend the time to learn how to set them up. Similar options are available for Linux.

When we suggest them to customers we typically hear: "Buying Microsoft Windows, Office and possibly a virtualization product and learning how to use them together with what I already have is a lot of work, and we switched to get away from poorly designed software, your products excluded of course".

If you're in this boat, we suggest looking at some of the free services we offer online to:


If your computer has a reasonably modern browser, can send and receive e-mail, read DOC files and PDF files, it can use the above sites. They're free, easy to use, and do a few of the things that people commonly use our software for.

Why the Desktop Still Matters

If privacy is a concern (all your files are transmitted to the above sites and back without encryption) or you need to use some of the more advanced features of our software, we felt it would be useful to outline some of the options you have on OS X and Linux. Technical details on how to implement them are outside the scope of this post (honestly, there are so many resources available with just a few Google searches away the information would be redundant).

1. Dual Booting.

In a nutshell you divide your hard drive in two (or more) and install an additional operating system on your computer. When you reboot you get an option to boot into one OS or the other.

This typically offers the best performance of all the options available, at the cost of the inconvenience of having to reboot each time you want to use applications on an OS that you aren't booted into at the moment.

- Dual Booting on OS X.

Apple's solution for dual booting on their computers is called Boot Camp. Apple has the rundown on how to set it up on their website.

This requires an Intel Mac, a recent version of OS X (it was taken out of beta with version 10.5), a license of Microsoft Windows and a license of Microsoft Office for Windows (we recommend 2003 or newer). Be sure to read Apple's system requirements for the full and most recent list of what you'll need.

- Dual Booting on Linux (is now easy)

Linux has a number of different ways of dual booting with Windows, the easiest of which is called Wubi. As with OS X, you'll need a copy of Microsoft Windows and Microsoft Office.

2. Virtualization

Virtualization is running Windows in a window so that you can use Windows applications on Linux or OS X. If this seems a bit like a Rube Goldberg machine (or a Yo Dawg joke) you're right, but so are so many other things we use on computers on a daily basis.

If you've got a little time, the willingness to read and/or Google minor problems and enough of a computer to run two OSs side by side, virtualization is a great option. This does require that you have a license of Microsoft Windows and Office to install in the VM.

- Virtualization on OS X

Newer Apple Macs (Intel based ones) can run virtualization products. Common applications for this include Parallels Desktop, VMWare Fusion and Sun VirtualBox.

Please note that no one in our offices owns any Intel based Macs and we haven't tested any of the above products. YMMV (Your Mileage May Vary).

If you happen to use our software on a Mac in this way let us and the other readers know about your experiences in the comments below.

- Virtualization on Linux

Two commonly used desktop virtualization products on Linux are VMWare Workstation and Sun VirtualBox. In our experience both are fine if you just plan on using the VM to run Windows applications.

If you plan on doing complex software QA (the kind that involves installing and uninstalling and installing and uninstalling...) you may find that VMWare Workstation is a better fit for you with it's better support for multiple trees of snapshots. Of course if you have no idea what snapshots are you may want to try both to see which works better for you.

- Wine (Wine Is Not an Emulator)

From their website:
"Wine is a translation layer (a program loader) capable of running Windows applications on Linux and other POSIX compatible operating systems. Windows programs running in Wine act as native programs would, running without the performance or memory usage penalties of an emulator, with a similar look and feel to other applications on your desktop."

Basically this lets you run some Windows applications on Linux without the need for Windows.

This tends to work for a few supported applications but we haven't ever had good success with our own products. As with many things involving Linux, we cannot rule out user error on our part and are merely offering cautionary information :>.

We tried using Solid PDF Tools with Wine version 1.1.21 on Arch Linux. It kind of worked with a few files (formatting was lost) and hung on a few others that the product normally can convert in Windows.

If someone can suggest how to configure Wine to work better with our products we'd be happy to know (post comments, e-mail us, send a bananagram, etc.). Until then we'd suggest using Virtulization to use our software on Linux.

Did we miss anything you love? Feel free to contact us, or let everyone know about it in the comments below.

3 comments:

David Gerard said...

If you have the code and want to make your stuff work on Wine, the Wine developers and users can be very helpful. Could be you use stuff that just won't be in Wine yet for a while, could be something simpler.

e.g. what's the output when you start the app from a terminal? It should spew a list of stuff it can't quite do. (If it's a "FIXME", ignore that - if it's "Err:", that might be it.)

Then you can add your app to this list and you'll have a small but ardent group of users on Linux ;-)

First port of call would probably be the user forum: http://winehq.org/forum .

Solid Documents said...

Thanks for the info David. :)

When I first run Solid PDF Tools with Wine I get the message below in my terminal:

"""
fixme:msxml:domdoc_load VT type not supported (9)
XPath error : Undefined namespace prefix
xmlXPathEval: evaluation failed
fixme:msxml:support_error_InterfaceSupportsErrorInfo (0x146f18)->({2933bf81-7b36-11d2-b20e-00c04f983e60})
wine: Unhandled page fault on read access to 0x00000000 at address 0x1309e26 (thread 001f), starting debugger...
"""

A window appears saying that "The program SolidPDFTools.exe has encountered a serious problem and needs to close..."

Closing the window dumps the stack from Wine, and then our product appears. (I'm guessing this is the splash screen crashing, and not the main product)

I then tried converting our license agreement from the folder our software is installed in into a DOC file on my desktop. This worked well.

I then tried converting another sample file I downloaded from our website:

http://www.soliddocuments.com/samples/pdf_orgplus.pdf

After a few minutes the conversion failed. The output from my terminal was:

"""
err:ntdll:RtlpWaitForCriticalSection section 0x7e4f91c0 "handle.c: MSCMS_handle_cs" wait timed out in thread 0032, blocked by 0009, retrying (60 sec)
<...snipping fixme messages...>
err:eventlog:ReportEventW L"7ef8625d"
err:eventlog:ReportEventW L"3160000"
err:eventlog:ReportEventW L"c0000194"
"""

Googling some of the above error messages isn't particularly helpful, so I think that you're right that posting the question to the winehq forum would be the next step.

David Gerard said...

Yeah, that MSXML one looks like MSXML6, which hasn't been implemented fully in Wine yet. Though you can install the Microsoft version easily enough with Winetricks, a script to install certain native DLLs into your Wine setup.

Er, yes, run it in the latest Wine then ask the forum in the first instance :-)