Saturday, July 29, 2006

Adobe Reader 7.0.8 for Linux

In "Crystal Reports" example, we were able to print report by exporting it to PDF file, which was displayed in doknir inside KGhostView windows. Unfortunately, KGhostView is not able to display certain complex PDF files. There is also no plugin for web browsers. Finally, even simple PDF is not printed correctly, if it is in landscape A4 format, for example.

Then there exist XPDF, poppler (XPDF fork), KPDF (which was based on XPDF, but now uses poppler), Evince (GNOME viewer, based on poppler). None of the packages convinced me!

So, only Adobe Reader remains. This used to be a problem, because there was no version 6 for Linux. This has changed with Adobe Reader 7. The installation file (.tar.gz) is larger than 40 MB.
Unzip it and go to Konsole, enter command sux and start installation with ./INSTALL. When the script asks about installing plugin, answer yes (and if it wants to owerwrite nppdf.so, also answer yes).



If PDF is by default still opened by KGhostView, we need to change the application preference order. Start Konquerer, go to menu "Settings">>"Configure Konqueror...", click on "File associations", click on + before "applications", select "pdf" and move "Adobe Reader" to the top:

But there exists big difference between Linux and Windows version - "Digital Editions ..." is not listed in the "File" menu of Adobe Reader for Linux!

The following text is from Adobe documentation:

Q: What is a digital edition (formerly known as an eBook)?

A: A digital edition is an electronic edition of a physical book, magazine,
journal, newspaper, sheet music, or newsletter. A digital edition is a file that
has been converted to Adobe Portable Document Format (PDF). Adobe digital rights
management (DRM) helps protect Adobe PDF files.

---
System Requirements
The digital edition capabilities of Reader 7.0 and Acrobat 7.0 are supported on the following operating systems:

  • Windows® XP Professional, Home, or Tablet PC Edition
  • Windows 2000 with Service Pack 2 or later
  • Mac OS X version 10.2.4 or later

---
You must activate Adobe Reader before you can use it to purchase or read Digital Editions. Adobe Reader automatically starts an Easy Activation the first time you attempt to open a protected Digital Edition. To move documents to other computers, you must complete the full activation using an Adobe ID or .NET Passport login:

  • If you have just completed an Easy Activation, click the Sign In And Reactivate button on the congratulatory page that appears after the Easy Activation process, and follow the on-screen prompts to complete the full activation.
  • In Adobe Reader, choose File > Digital Editions > Authorize Devices. On the Adobe DRM Activator website, sign in using your Adobe ID or .NET Passport ID and follow the on-screen instructions to activate Adobe Reader.
  • Go to the Adobe website at http://aractivate.adobe.com (Adobe DRM Activator), and follow the on-screen prompts.

DRM (Digital Restrictions/Rights Management) is mentioned above - you can read more about PDF and DRM relation in the two parts essay by John Mark Ockerbloom (1 & 2).

[]

Tuesday, July 25, 2006

Expand (resize/enlarge) virtual disk

Only for advanced users!


This is quite complicated procedure (because of reiserfs partition), so if you are not advanced user, I recommend to wait for "doknir II" which will be released in fall 2006.

For adventurous people, here are the details for growing VMware virtual disk:
  1. We will need the latest version of "resize_reiserfs" utility:
    apt-get update
    apt-get install reiserfsprogs
  2. Close virtual appliance and copy entire folder to new folder.
  3. Resize virtual disk in new folder using "Virtual DiskFactory". There must be VMware Server or Workstation installed, because utility depends on "DiskManager GUI" (command is vmware-vdiskmanager):

  4. Add enlarged disk to original VM as second SCSI disk (sdb)
  5. Start virtual appliance
  6. Use QTParted to remove linux swap partition (do not forget to commit) from second disk
  7. Start Konsole and type sux
  8. Use fdisk to change partition table of second SCSI disk (this will not delete data) in the following way:
    - delete existing partition sdb1 (Start Cylinder: 1, End: 283)
    - create new partition (Start Cylinder: 1, End: 450)
    - write changes to partition table and exit
  9. Start QTParted and create linux swap partition from remaining free space (cylinders from 451 to 509). Commit and exit!
  10. Expand the filesystem to fully fill the new size of the partition with the following command:
    resize_reiserfs /dev/sdb1
  11. Close VM and remove second SCSI disk from it
  12. Start new (cloned) VM.
  13. Verify the size of partition:

[]

Free disk space

One of the ways to see how much of disk space is used is to run 'QTParted' utility, which is located in 'System' menu of 'K' menu:


There is another way that does not require root password: "KInfoCenter" in "System" menu (click on Partitions):


According to the above screenshots, it's time for enlarging doknir's virtual disk ...

[]

Resolution (display size)

Default screen resolution of doknir is 1024×768. Since screen resolution of my host is 1600×1200, I decided to enlarge resolution of virtual appliance to 1400×1050. Here are the steps:
  1. Start Konsole and enter command sux
  2. Start: vmware-config-tools.pl
  3. Accept default answers to all question by pressing key 'enter' until the next question:
    Do you want to change your guest X resolution? (yes/no) [no]
  4. Reply with 'y' and select new display size:

Restart the virtual appliance!

BTW, maximum size is 2364 × 1773 !

[]

Monday, July 24, 2006

Crystal Reports

In two previous posts we saw examples from "academic" world: .DJVU and .PS files. Now let's take a look at an example from "business" world. Here is a quote from wikipedia:
Crystal Reports is a Business Intelligence application used to design and generate reports from a wide range of data sources. Several other applications, such as Microsoft Visual Studio, bundle an OEM version of Crystal Reports as a general purpose reporting tool.
BTW, there also exists "Crystal Reports for Delphi 2005".

We can download Crystal Reports XI trial (or Crystal Reports XI Release 2 with support for Visual Studio 2005) from "Business Objects" website. We also need a database - DBF (dBase) file is the simplest Here is one inside ZIP file (language classification table by Dr. Stephen Huffman).

Before we start building report let's stop Microsoft Windows Print Spooler (since doknir is its replacement). This can be done in several ways:
  1. Enter command net stop spooler in Windows Command Prompt (cmd).
  2. Start "Control Panel"->"Administrative Tools"->"Services". Double click on line "Print Spooler" and click on button "Stop".
  3. Same as 2.) but you can open "Services" tool using Start->Run dialog by entering command: services.msc
We can verify that print spooler is not running by trying to "Add Printer" - the following message should appear: "Operation could not be completed. The print spooler service is not running".

Now, start Crystal Reports (I use version 10) to create new report based on DBF file (BTW, I tried to open existing report and the following message appeared: "Invalid Printer: The default printer is not valid. Printing will be disabled.". Obviously, Crystal Reports was confused because windows print spooler was not running. Well, thanks to doknir, we will be able to print report :)

Anyhow, click on "New" in menu "File" to start report creation wizard. The most important thing is to choose the data file. To do this, click '+' in front of "Create New Connection" and then click again on '+' in front of 'xBase'. Select 'lang_family.dbf':

Continue with report creation by clicking on 'Next'.

Let's take a look at "Printer Setup" in File menu. As we can see "No Printer" is checked and disabled. Default "Paper Size" is Letter and if we click on combobox, there are only five choices: A4, A5, B5, Legal and Letter:



There is no custom paper size!!! It is sad that after so many years "Crystal Reports" are still based on printer drivers. I hope that it will be possible to define custom page size in version XII.
For example, Microsoft Word does not depend on windows printer subsystem since version Word 97, according to this article (KB 166016):
Use printer metrics
to lay out document

If this option is
enabled, Word will
use the information from the printer
driver that is installed as in some
earlier versions of Word.

If this option is
disabled (default),
Word will use build-in metrics to lay
out the document. This means your
document will look the same no matter
what printer driver is installed.
Here are some additional arguments why it is not good to rely on printer drivers.

Back to Crystal Reports - how to print our new report? Fortunately it is possible to export report to PDF file by clicking on "Export..." in "File" menu:



Open folder where new PDF report is saved, right-click on PDF file and choose 'doknir' to "print" it in virtual appliance - it will appear inside KGhostView window. For example, I printed and scanned first page and bellow is the result:

Can this process be simpler? Of course ... [in work]

P.S. For more information about Crystal Reports, read "Underground News" by Ken Hamady or read free chapters of new book by Brian Bischof.

[]

Friday, July 21, 2006

VMware Server 1.0 (build 28343)

VMware server 1.0 was released (2006-JUL-10). Instructions from previous post for installing new VMware tools are still OK:

[]

Monday, July 03, 2006

DjVu klik

No, it's not a mistake - I don't want to discuss about "Deja Vu" and "Click"! I will talk about "DjVu" and "klik".

DJVU format is similar to the Adobe Acrobat PDF, but unfortunately less known (despite its qualities). You can read about it in article (DjVu: Saving for our paper heritage) on NewsForge. It is also mentioned in the following article: Playboy Seeks Digital Exposure.

One way to install DJVU in Kanotix is using "klik" at http://klik.atekon.de. After some investigation I came to the conclusion that this was not the best way because:
  1. Latest version is not available.
  2. Only standalone viewer is installed - there is no browser plugin.
  3. Application is not automatically associated to the .djvu extension.
So we will use "apt". Before installation we must update information about packages (if we don't do that, apt will try to install older versions of packages, which will result in error because they will not be available on Debian servers anymore):


  1. Start Konsole and enter command 'sux'
  2. Start apt update with command:
    apt-get update
    The process can take several minutes:
  3. Install DJVU with command:
    apt-get install djvulibre-plugin
  4. After installation we can check the versions of packages:
    apt-show-versions | grep djv*
    Here is the result:
    libdjvulibre15/testing uptodate 3.5.17-1
    djvulibre-plugin/testing uptodate 3.5.17-1
    djview/testing uptodate 3.5.17-1
  5. Close Konsole.

Now we can switch to our beloved Windows host and try to find some DJVU files. Let's go the first server of the University at Albany, running since September 1993, called OMEGA. There are several files with .djvu extenstion - let's download "euclid.djvu" (BTW, it is much smaller than PostScript file). Open folder where downloaded document is located, right-click on .djvu file and select "doknir" ... DJView will start in virtual appliance. At first start, set the viewer preferences:

If you wish also make the toolbar always visible. Now let's print first (current) page. In the "Print Dialog" there is a "Print Command" setting - default value is "lp", but better alternative is "kprinter --stdin":

Here is scanned first page:
So, today '.djvu' wins over '.pdf' and 'apt' wins over 'klik'!

QED.

P.S. DJVU is part of the OLPC (One Laptop Per Child) project.
[]

Saturday, July 01, 2006

PS - PostScript (.ps)

Yet now and then your men of wit
Will condescend to take a bit.
- JONATHAN SWIFT, Cadenus and Vanessa (1713)
OK, we've prepared both windows and linux executables and mounted shared folder. Both executables are running and printer is ready so we can finally test 'doknir'.

For the first test I've choosen format that is by default supported in Linux, but not in Windows: PostScript. There are different ways how to add support for PostScript documents to Windows:


  1. GhostScript and GSView
  2. Adobe Acrobat Distiller
  3. CygWin and ps2pdf
  4. http://www.ps2pdf.com/
  5. PStill

Thanks to the virtualization there is another way to view and print postscript files: doknir! First we have to find a postscript file. Let's go to the Donald Ervin Knuth website. There are sneak previews of Volume 4 of "The Art of Computer Programming" (TAOCP), for example Pre-Fascicle 0b: Boolean Basics. It is compressed postscript file (.ps.gz), which can be unzipped with 7-zip or WinRAR. Open folder with unzipped document (fasc0b.ps) and right-click on it:

Click on 'doknir' and wait until the document appears in virtual appliance:



Let's print page 5:




Here is the scanned result:


QEF.

P.S. Can this process be simpler? Of course ... [in work]

[]