An idiot's guide to PDF
Ever wondered what a PDF file was? Ever wondered how you could make them or view them? No? Well read Aaron Timbrell's explanation anyway.
PDF, as any fool knows, stands for Printer Definition file. Well, yes it does, but it also stands for something else, Portable Document Format. So what is a Portable Document?
The Portable Document Format
The PDF format was developed by Adobe to allow easy transport of printed documents in a digital form. The idea is simple, you can open a PDF file in Adobe Acrobat (a free application for Windows) and it looks just like a book, only on screen. You can print it out and it will look just the way the writer intended. PDF files can include pictures and fonts, so the file will look the same on any computer that can read PDF files. PDF is now the de-facto standard for distributing manuals, technical information in fact a whole host of material that normally would be printed. Whenever you buy a new printer, scanner or digital camera, the Windows CD that comes with it is guaranteed to include documentation in PDF format.
PDF files have a number of advantages over other ways of distributing information: firstly they will appear the same on all computers (provided the program that is displaying the PDF understands it properly). Secondly they can include hyperlinks - so clicking on a reference in the index will take you to the correct page. The third advantage is size; PDF files are quite compact and hence take up little disk space. The full technical specification for Adobe Illustrator files (which can be downloaded from Adobe's web site) runs to over 166 pages, is fully illustrated yet is only 1MB in size, approximately 900 bytes per page. Further space savings can be obtained by compressing PDF files using SparkFS or WinZip.
PDF files can also include foreign languages (i.e. non Eastern Europe) and will display the same on a PC running a Cyrillic version of Windows, with Russian fonts, as they will on a UK spec machine without the fonts. PDF files are normally fully self contained, everything required to reproduce the document exactly as intended is included in the file. This has lead to the use of PDF files as a means of sending documents to printing houses. Before PDF files were usually sent as PostScript™, but this can cause problems, with missing fonts, incorrect page sizes and a host of other potential problems waiting to trip up the unwary. However with PDF files you know that the file will always be the same and will always be complete, provided the program you are using to view the PDF file understands it of course.
That roughly sums up what a PDF file is, but what can we do with them under RISC OS? The program that is used to make PDF files on PC and Macintosh machines is Adobe Acrobat, to view and print documents the free Adobe Acrobat Reader can be used. You may think that once again RISCOS users are penalized by this reasonably recent technology, but you'd be wrong.
PDF Viewer is a freeware program written by Leo Smiers and Derek Noonburg. It allows you to view a PDF file on screen, print it out, and also save out pages in various formats such as Draw and text. PDF Viewer will handle many documents, but by no means all. Like many aspects of computer technology, PDF files have been changing to include new developments, and PDF Viewer just cannot handle some newer files at all. Even on older files it can make mistakes, particularly when it comes to rendering greyscale or colour graphics. However it's free, works most of the time and will often allow you to view PDF files that otherwise would remain a mystery.
GhostScript is another freely available package, supplied under the Alladin Free Public licence, which basically means that you can distribute the package, provided you do not charge for it, and that as a single non-business user you do not have to pay for it. GhostScript started out as a Unix/Linux package, and is command-line driven. You don't get any nice WIMP based front end, so if you want to actually make it do anything you have to wade through the documentation and then write Obey files to make the thing work.
For example the Obey file shown below will convert the named PostScript file to a PDF file.
WimpSlot -Min 10000K -Max 10000K ps2pdf ADFS::HardDisc4.$.Printout ADFS::HardDisc4.$.GhostScrip.PDF/PDF
As you can see this is not user-friendly. However, if you can get to grips with GhostScript, and you have enough memory (I recommend at least 32MB) then you have a powerful package that can preview PostScript files on screen using the optional GhostView application, can convert files into a number of other formats, and can generate very compact and well-defined PDF files using some of the most modern techniques. As a free package GhostScript is superb, if you are prepared to spend the time getting it to operate. If you are not, and you would like a proper front end that makes sense, then you will need a decent well-supported commercial package, such as RiScript PRO.
RiScript Pro is supplied on two floppy disks, with a 64-page printed ring-bound manual. Installation is simply a matter of dragging the application from the archive on disk one to your hard disk. Disk two contains sample files and other resources. One small problem then appeared, RiScript Pro requires the nested window manager, and the machine I was using didn't have it installed. To be fair to Cerilica it does say on the front of the package that the latest !Boot upgrade, or RISC OS 4 is required, but it might be nice for the warning to be re-worded to make it more obvious. Running the package is just a matter of double clicking, if you then want to view a file such as a PostScript document, simply double click on it and it will appear in the RiScript window.
RiScript is a very easy application to use, and the manual makes an excellent job of explaining the different types of files that RiScript can handle. The manual also contains a very good explanation of PostScript, PDF and EPS (Encapsulated PostScript) files. Along the top of the RiScript window are simple and easy to use controls that can be used to move through the pages in multiple page documents. Along the bottom of the window are buttons to set the size of the screen display, the paper size & the angle the document will be displayed (in 90 degree steps). Once you have your document in RiScript there are a number of things you can do with it. Firstly you can view it, very useful if you are checking a file before sending it to someone. Secondly you can print it, again very useful if documentation has been supplied in PDF format. Thirdly you can convert the file to something else; for example, you can load a PostScript file created using the Acorn printer drivers and export it as a PDF file.
RiScript Pro also offers a wide range of configuration options, including full control over the memory allocation used by the internal PostScript RIP (Raster Image Processor). There are also options to control how fonts are translated when you make a PDF document. You can also configure the amount of multi-tasking used when first displaying a file. By default RiScript Pro multi-tasks while first rendering the file to screen, this results in an initially slow update, but keeps the computer usable while files are processed. Once the whole file has been processed screen update is then almost instantaneous. This type of feature demonstrates the thought that has gone into the package.
Font handling is also included with RiScript Pro. If you use the default RISC OS fonts, such as Homerton, then the file will be much smaller. This is due to the way that PDF files work, if you create a file using Homerton, and then view it on a PC the font Arial will be used for display. If however your document contains other fonts then these need to be included in the document. RiScript Pro can do this by converting each line of text into shapes that can be rendered on any machine; while this results in larger files, the finished PDF will be identical to the original file. The printed manual covers all this in great detail and any user of the package would be well advised to read this section.
PDF files generated on another platform may not have all the text changed to shapes, but may include the fonts with the document. In this case RiScript Pro can generate an Acorn version of the font from the data in the file and then that font can be used just like any other Acorn font. All such converted fonts are stored in a special directory inside the RiScript Pro application. Its a bit of a shame that RiScript Pro cannot convert Acorn fonts and store them inside the document, as this would result in smaller files that rendered faster on other machines.
RiScript Pro handles PostScript files as generated by the RISC OS printer drivers as its input. You cannot load a Draw file into RiScript and then export it as PostScript or PDF. You must first use a PostScript printer driver, configure it to print to file and then print from your application. This is the normal way that a user would make PostScript files to send off to a bureau. These could then be printed onto film and user by a commercial printed to print the job on a printing press. RiScript Pro allows you to check the file and see that it looks correct before you send it. This could in theory save a lot of money and heartache, as anyone who has ever had a PostScript file go wrong will testify.
So who would use RiScript Pro? Anyone who wants to transfer documents from an Acorn to a PC and keep all the formatting, fonts and graphics intact. Also anyone who makes PostScript files and want to check them before sending them to be printed. However if you are creating and viewing files commercially then you should be aware of a few problems that I experienced with RiScript Pro (home users are quite unlikely to encounter these glitches).
Firstly the preview of PostScript files on screen can be wrong in some circumstances, a file can appear to be faulty, but in fact be correct. Interestingly the Draw file export seems to always be correct, it is only the display on screen that is wrong. Secondly RiScript could not handle some PDF files generated by GhostScript, even though the files worked fine in Adobe Acrobat. This does raise the worry that RiScript won't be able to handle all the types of PDF file you can throw at it. Thirdly RiScript wouldn't work with some EPS files, items like AdobePackedArray caused the program to reject the file. I have passed details of these problems onto Cerilica and they have promised that they will be looked at in a future major upgrade planned for later this year.
If you want to view the odd PDF file then get hold of PDFView, after all it is free. If you are interested in generating PDF files to send to other people and you don't mind pulling your hair out and having a fast machine with plenty of RAM - and some technical programming skills - then get hold of GhostScript 5.50 and see if it works for you. If, like most people, you want an easy and quick way of viewing and generating files then buy a copy of RiScript Pro and just use it; it may not be perfect, but it's very, very close.