Monday, January 31, 2011

Installing the .wwf toolkit under Windows

Introduction
Converting a PDF file to .wwf is so trivial under Linux that a bunch of shell scripts is enough to perform that task. When a user asked me whether it could be ported to Windows I was bewildered. Running Unix shell scripts under Windows means you have to trick Windows in thinking it is running a Windows program and the shell scripts in thinking they're running in a Unix environment. But all components were available for Windows, so I decided to give it a try. Note I tried Win98 as well, but that didn't work. You will need WinXP at least.

Preparation
First, you have to download all components:If you don't know what your Windows directory is issue this at the prompt:
echo %windir%

You can get a prompt by starting cmd.exe. I will refer to the Windows directory as C:\WINDOWS.

Installing WGET
Place the executable in C:\WINDOWS - or whatever your Windows directory may be.

Installing Poppler-utils
Unzip the archive and place all executables in C:\WINDOWS.

Installing PDFtk
Unzip the archive. You will only need the files in the bin directory. Place pdftk.exe in C:\WINDOWS and libiconv2.dll in C:\WINDOWS\SYSTEM32. Be sure not to overwrite previous versions!!

Installing Zenity
Simply accept all defaults, including the path. Install it on the C:-drive if you can, it will make your life much easier.

Installing BGstart
Simply accept all defaults, including the path. Install it on the C:-drive if you can, it will make your life much easier.

Installing MSYS
You may also take the newer 1.0.11, but note that version has packaging errors. Simply accept all defaults, including the path. Install it on the C:-drive if you can, it will make your life much easier.



Finally, a console will pop up, posing you two questions:
  1. Will you continue the postinstallation [YES]
  2. Have you installed MinGW? [UNLIKELY]
If you installed MinGW before (which is a C-compiler) you probably already have MSYS anyway.

Installing Ghostscript
Simply accept all defaults, including the path. Install it on the C:-drive if you can, it will make your life much easier.

The Windows-version of Ghostscript fortunately comes with Unix scripts of the major utilities. They are all located in the lib directory. You have to add this directory to the path so MSYS can find them. That's not very hard. Simply click the "My computer" icon, then click "Control Panel" and finally "System".



Choose the tab "Advanced" and click the button "Environment variables":



Choose "System variables", then "Path" and add the directory in question up front. Usually, this will be something like C:\Program files\gs\9.00\lib.

Installing .wwf toolkit
MSYS has left an icon on your desktop. Click it. Then navigate to the wwftk-1.7.tar.gz archive. You can use cd as usual, no need to change drives. Note backslashes become slashes and drives become directories, e.g. H:\download\wwftk-1.7.tar.gz becomes /h/download/wwftk-1.7.tar.gz. If the path contains embedded spaces, enclose it with double quotes. Assuming the archive is located at H:\download, issue:
cd /h/download
tar -xzvf wwftk-1.7.tar.gz
cd wwftk-1.7/Windows
sh installwin.sh c

If Ghostscript wasn't installed on the C:-drive adjust accordingly. If all goes well, you'll see the following screen:



After that, .wwf tools is installed.

Post installation
You probably want to start the .wwf tools from the screen. All you have to do is to make two shortcuts. First, click right on the desktop and select "Shortcut":



Second, choose "Browse" and navigate to C:\msys\1.0\share\wwftk\bg_pdf2wwf.bat.



Third, choose a name for this shortcut. I prefer PDF2wwf.



Basically, the shortcut has been created now, but it is not very attractive. Right click it and choose "Properties".



Click "Change icon" and "Browse".



Navigate to C:\msys\1.0\share\wwftk.



Select wwf128.ico.



Select the appropriate icon and press "Ok". Repeat the same procedure for wwf2pdf and you're done.

Wednesday, January 26, 2011

The WWF driver gets competition

A user on the "Save as WWF" Facebook page asked me whether I could port the .wwf toolkit to Windows. It took some research, because emulating a Unix environment on Windows is very quirky, but I did it. I posted some screenshots this morning, but they were not amused. Within hours they were taken offline, despite their promise not to censor. Obviously, they don't like the competition. And for good reason..



First, the .wwf tools allow you .pdf to .wwf conversion. And vice versa. That is by design. Second, you can choose whether you want that banner or not. The WWF driver always appends that free WWF advertisement to each and every document it processes.



And despite some rumors, it cannot be disabled. That is by design. Third, the .wwf tools produce much smaller files. Finally, it doesn't phone home. Feel free to examine the code.



In the meanwhile, the WWF have acknowledged they are violating the BSD license which comes with the OS/X PDF reader "Skim". They promised a new version. Yeah, right..



Their bug ridden Windows driver is still at v1.03. Release Candidate, that is. I'd rather use a beta of .wwf tools.. ;-)

Friday, January 14, 2011

The .wwf format in practice

This week I promised myself to put the .wwf format to the test. So, I sent a .wwf file to my girlfriend at work and I distributed all documents at work that I didn't find worth printing in the .wwf format. These were the reactions I got:
  1. My girlfriend wasn't even able to open it, because the MIME-type wasn't known in her Vista installation.
  2. I p*ssed off a very expensive consultant at work who ordered me to send a printable version or I'd have to look for another assignment.
  3. A colleague of mine who prints virtually everything sent it to another nerd colleague of mine who returned a printable version of the document using my "cracking" pages.
I asked them whether they had become more "aware" of the issue at hand. Most thought it was merely a nuisance, others said they would never donate a dime to the WWF anymore.

Update: For some reason unknown, WWF Italy is now collaborating with forest managers to "develop awareness on the issues of sustainable management of forest resources" and "promote (..) the purchase of forest products"!

Update: As I predicted, the WWF violates FOSS licenses.

Update: The WWF have promised to comply to the "Skim" BSD license. As always, I'm not holding my breath. Even with a buglist the size of your arm, their Windows driver is still the same old v1.03 Release Candidate.