Creating PDF from Any Application

This is a version of a post I made on the Kororaa forums in the Tips section. It has application to more that just Kororaa so I repeat it here.

There are many tools available for Linux, too many for one person to get to know them all so this is an introduction to just one. One of those hidden gems is Cups-PDF. This short introduction to Cups-PDF will tell you what it is and what you can do with it.

Quite simply Cups_PDF is a virtual printer that creates PDF files. It can produce a PDF file from any application that can print. It is simple to use as it behaves just like any other printer.

Why Use It?

Why use Cups-PDF when LibreOffice can create PDFs? Cups-PDF works with every application that can print. Also it can do a couple of things that the built in LibreOffice PDF can’t.

Activate Cups-PDF

Although cups-pdf is installed with every Kororaa system it will need to be installed on many Linux systems including Fedora. Use your favourite package manager, in most distros the package name is ‘cups-pdf’. There is one step needed before it can be used. It needs to be added to the printer list. Select “Printing” from the menu, (actual name on menu and the location differs with different desktops) or in a terminal run ‘system-config-printer’

Click the ‘+’ and the system will show you the available printers. Select ‘Generic Cups-pdf Printer’ and it will search for a driver. Select the recommended ‘generic’ driver and select the recommended options. I found system-config-printer slow to do each step so be patient, it will get there. When it returns to the Printing window you can right click on the Cups-pdf icon and change some options, go to Properties – Printer options. I usually reduce the dpi setting as I don’t normally want a high quality output. The minimum setting is still quite good.

There is a configuration file at /etc/cups/cups-pdf.conf but it doesn’t have many options. Fortunately it is well commented so you can see what each option does. The one you might want to change is the output location, the default on Fedora and Kororaa is the user’s desktop.

Using Cups-PDF

Using it is simple. Just select it as the printer and print. A file with the same name as the original with the extension changed to pdf will appear on the desktop. It also changes any spaces in the name to underscores.

One of the things I use Cups-PDF for even in LibreOffice is to use some of the printing options. E.G. you can change the number of pages per sheet in the printing screen but this option doesn’t exist in “Export to PDF”. Experiment with it you may find Cups-PDF is a better alternative than the built-in option plus it works with other applications.

One thing Cups-PDF can’t do, but the LO built-in PDF converter can, is create bookmarks within the document. At least I haven’t found a way to do it, if anyone does know please add a comment.

 

Advertisement

Of Data and the Base

It is not surprising that the first thing most people install after the operating system is an office suite. It is one thing that is standard in all Linux distros too. Even if you only write the occasional letter it is an application that everyone seems to use. Perhaps the least used part of most suites is the database. In fact it is not included as a standard part of every office suite. Base was not added to OpenOffice until version 2 and even Microsoft only includes Access in the more expensive version of Office.

However I have always thought that database apps are undervalued. Few people realise the power of them and I guess the steeper learning curve deters the more casual user. I have made extensive use of various database apps for sometime now. Strange to say though the most ubiquitous one (Access) is one I have no experience with. I am not talking of full professional multiuser solutions but I do need something more than the basic Mailing list. So when I started using Linux it was natural that I would look for a database solution that ran under Linux.

When I heard Base was to be added to OpenOffice, yes that is how long ago this story starts, I was very excited. The other OO packages had proved useful replacements for the Office suite I was using at the time. In fact I started using OO in Windows before my move to Linux. When I experimented with Base though I was disappointed. I found it clunky, slow and counter-intuitive. It was only after finding a couple of tutorials online that I could get anything done.

Perhaps I was being unfair to Base as it was an immature product at the time and I was used to something with over a decade of development behind it. I had been using Approach which was part of the Lotus suite. It had always been a powerful yet relatively easy to use application. Lotus is part of IBM and they are no longer developing the Smartsuite which included Approach. They have released a beta of Lotus Symphony that is based on OpenOffice. At this stage there is no indication they will be adding a database application although there is strong support for it on the forum on their site.

In fact I had not found anything I wanted to do that I couldn’t find a way to accomplish using Approach. And I have never needed to use scripting either. Sadly that is not something I could say about other applications. An example is the simple use of a calculated field. A calculated field is one that the content is automatically developed (or calculated) from other field(s). A simple example would be the addition of tax in a price list. If you had a list of products you would type in the price and the tax code / percentage and the final selling price would be worked out. Of course this could be done using reports but if you wanted a quick visual reference you could use without the need to print price lists a calculated field is the easiest way. There are many other uses and they don’t need to be numeric fields either. In Approach it was simply a matter of defining the field as a calculated field and defining the formula and it worked. In Base it required the use of a query and adding that query as a displayed field. It is necessary to manually edit the SQL statement to ensure the result is formatted the way you require. And that is just one example.

I don’t want to spend the time developing a professional solution using mySQL or Firebird although they would do what I require. It would be like using a freight train to bring home the groceries. So what are my alternatives?

Well Base works for simple databases and can be forced to do some powerful things but it is slow and difficult to use. I hope it gets the development it deserves as it could be a useful tool with a better interface. Another option I found was Kexi. Kexi is part of the Koffice suite and my first impressions are good. It was easy to start using with an intuitive interface and good layout. I was able to create a simple table without using a tutorial or even the help screens. I haven’t worked out if it can do everything I require but it is worth a further look.

The other option is to stay with Approach. I have found it will run, with some restrictions, under Wine. For those who aren’t familiar with Wine it is an application that allows selected Windows programs to run under Linux and other ‘nix systems. No need to get into the technicalities of Wine but some programs run well and others with limitations. Unfortunately Approach falls into the latter category. It is possible to access and edit the data and even do simple maintenance work but creating a new table or report are among the tasks that are not possible. I have had mixed results with printing too. So I could do some day to day work with it but would require a windows system for any development etc.

That is what I am doing at the moment but long term I would like to consolidate everything under Linux. So the short term solution is to use Wine / Approach but long term I will give Kexi and other Linux apps further investigation. I would appreciate any suggestions for consumer level database apps that run under Linux.

Putting On the Fedora

As I have been having a few problems with Ubuntu on my desktop and I had read some good reports on Fedora 8 I decided to install a test copy. I used Fedora for a while some time ago, FC3 if I remember right and although I liked it it had some stability issues and it soon was replaced.

What problems do I have with Ubuntu? I have purchased a Canon lide25 scanner and there is a known problem with it under Ubuntu but there are work arounds in the forums. Also I never solved the USB sound problem. While it works under Rhythmnbox it doesn’t in Firefox and other programs. The OpenOffice Base problem mentioned a few days ago seems to be only in version 2.2 under Ubuntu. I have Feisty but none of these appear to have been fixed under Gutsy.

So I have installed a test Fedora on the same computer with Ubuntu (and XP). Here are a few first impressions.

I like Anaconda,the install program, as it gives me options for what will be installed. I can select to install only those things I need and not everything. This is how install programs should be. Why should someone else who doesn’t know what I want to use the system for select the programs I will have? The installation proceeded without any problems and it finished with an initial boot of the system and final configuration which included creating a user login.

It had recognised most of my hardware without problems. The display adapter and monitor were correctly set up and at the proper resolution. The desktop effects work as they do under Ubuntu. Both my scanners were available and working. Only one printer was detected, an old Epson inkjet which connects to the parallel port needed to be set up manually but only to the extent of making it autodetect then it was fine. The internet connection (not wireless) worked. So far so good.

To be fair it wasn’t perfect. Although it added XP to Grub the Ubuntu installation, which is on a second hard drive, was not included. I had to edit the menu.lst file. It then was accessible without problems. This was probably the most serious problem as Ubuntu is still my main system.

Another problem was during boot it was looking for ata3 and ata4 and would retry a number of times before failing. Once it was past there it ran fine. We will get back to that one.

OpenOffice Base was not part of the original installation for some reason. I added it and it didn’t have the problem I experienced with Ubuntu. I was able to create a new table and form easily.

The USB sound card appears to work everywhere as it should.

The update manager reported there were a large number of updates available and I wasn’t going to install them. This is only a test system and either way it will be removed after a short time. If I like it it will be installed as my main system. If not it will just be gone. However the update included a new kernal and the forums reported that fixed the boot problems (see we did get back to it!). So I installed the updates and a couple of hours later I had a working system that booted without problems.

So where to now? I will use it for a while and try out all the things I regularly do and see how it goes. So far I am impressed but we will see how it is after being used for a few days. I will report back.

Fedora 8 runs well and everything appears to work and without the fixes I had to do under Ubuntu and isn’t that how it should be?

Handling Data

I have been using OpenOffice for sometime. OpenOffice is the free fully featured office application that is available for Windows, Macs and Linux. It is the default office application in most Linux distros. It is compatible with Microsoft Office formats. As such it is a viable alternative to MS Office without the expense.

Like most people I guess my main use is Writer and Calc, the word processor and spreadsheet elements of OpenOffice. I have made a little use of Base, the database element. It is the newest part of OpenOffice and in some ways it shows. However it is quite capable of accomplishing what many users need. I have had few problems with it before.

When I tried to create a new database today I struck an unusual problem. After creating a table I tried to create a view using the wizard. The wizard ran fine but wouldn’t save. It gave no errors just sat there. The screen wasn’t locked or anything, I could cancel out without problems.

After doing a search I couldn’t find any similar problems but a few people mentioned their preference for using Sun Java instead of the free or other versions. I installed and tested with first version 6 and later version 5 and in both cases the wizard wouldn’t even run. I restored the free version and I was back to the former situation where the wizard ran but wouldn’t save.

Fortunately I had access to another system on my dual boot computer and it worked fine there. I am now not sure what to try next. Any ideas are welcome.