# Desktop Publishing

A desktop publishing (DTP) application lets you design a layout for a pamphlet, booklet, magazine or newspaper. Most DTP programs are based around PostScript, a powerful software mechanism that can describe vector images or an entire document. Such files work on any kind of machine, allowing data to be transferred across different computer platforms.

## PostScript

PostScript is a page description language (PDL) that can describe a font, a vector image, a page of text and pictures or a complete document. The PostScript language is vector-based, which means that it gives good results on any printer, whatever the resolution. However, only a PostScript-enabled printer or a PostScript application can understand the language. As a result, the output of a PostScript application must always be directed to a such a printer or stored in a suitable kind of document, usually an Encapsulated PostScript File (EPSF), Portable Document File (PDF) or PostScript file.

• The contents of a PostScript-based file can also be downloaded to a PostScript printer.

### PostScript Levels

A PostScript application or printer accepts PostScript descriptions on one of three levels. If it receives descriptions at a lower level it takes these as well, but it can’t accept those of a higher level. Hence a PostScript Level 2 printer accepts Level 1 and Level 2 descriptions but a PostScript Level 1 printer only accepts Level 1 material. The three levels currently in use are:-

###### Level 1

Highly reliable, although only supporting up to 256 characters in a font’s character set, making it unsuitable for Chinese or other pictographic languages.

###### Level 2

Supports thousands of characters, together with improved colour matching and speed.

###### Level 3

Accommodates 3D images, full-range colour or half-tone images, with over 256 grey levels, and non-Roman characters. It can also deal with HTML or PDF files, allows more fonts to be kept in a printer and lets each PostScript device have its own Web page on the Internet.

### PostScript Data

The PostScript language can describe the following kinds of data:-

###### Font

A PostScript font is a vector graphic and is therefore known as an outline font. The name of each font describes both the typeface and the style, as in Garamond Bold or Garamond Light. In other words, fonts of a different style are treated as an entirely separate font face. PostScript fonts can be scaled to any size without distortion, and the angle of characters can be adjusted to any value, accommodating various oblique styles. Fonts can be kept in the computer or in a printer, although PostScript applications usually download any missing fonts to the printer during printing.

###### Text

A line of text is reproduced using the last selected font. PostScript uses its own system for representing styled text, which means that copying or pasting such material between a PostScript application and a non-PostScript programme can cause styling information to disappear.

###### Object-Orientated Graphic

This kind of graphic element, in the form of vector description, uses less memory that a bitmap picture. A line described as a vector is specified by its length, thickness, start point and end point.

###### Bitmap Graphic

This kind of image, as created by a scanner or camera, is often reproduced on a 300 dpi laser printer using a square of 4 × 4 dots at 75 lines per inch.

###### Greyscale Data

This data can be used with a bitmap image (see above) to create a half-tone image.

### PostScript Display and Printing

A non-PostScript application normally uses the computer’s own drawing mechanism to create images on the screen or to create a bitmap image that can be sent to a non-PostScript printer. Most PostScript applications, on the other hand, operate entirely in the PostScript environment, only converting the material into a form understood by the computer when required on the screen. In the Classic Mac OS, for example, the PostScript data has to be converted into QuickDraw form.

• This conversion can make PostScript applications run slowly on older computers.

When a document is sent from a PostScript application to a PostScript printer, the printer itself converts the PostScript code into a bitmap by rasterising the image. It does this by means of a powerful built-in mechanism known as a raster image processor (RIP).

• Some PostScript applications can’t be used with a non-PostScript printer, or the results may be poor. You could try a software RIP program, although this can slow down printing.
• You must install Adobe Type Manager (ATM) to use PostScript fonts on a non-PostScript printer in the Classic Mac OS. ATM doesn’t process any other kinds of PostScript graphics and isn’t required in Mac OS X.
• Many PostScript printers are laser devices with a resolution of 300, 600 or 1200 dpi, usually with network connections. Some machines also accept Hewlett-Packard’s Printer Control Language 4 (PCL4) or PCL5 instructions, while others emulate older printers, such as a Diablo 630 daisy-wheel printer, sometimes in a 12-point Courier font.

### Drivers and Bitmaps

The Classic Mac OS provides support for PostScript printers via Apple’s LaserWriter 8 printer driver. This Chooser extension resides in the Extensions folder, along with the Printer Descriptions folder, which should contain a file that’s appropriate to your particular printer. Other drivers, such as AdobePS, can also be used with these standard printer description files.

The Mac OS has a default screen resolution of 72 dpi. So, when a bitmap image is viewed at four-times screen magnification the resolution is really 288 dpi. Unfortunately, this means that the pixels on the screen don’t correspond with those on the printer at 300 dpi. To fix this problem, the Page Setup window for LaserWriter 8 has a Precision Bitmap Alignment option. This reduces the image to 96% of its size, ensuring the pixels of the source image align with those of the printer.

### Enhanced Printing

Some LaserWriter printers contain PhotoGrade software that adjusts the size and position of the laser, giving a significant improvement in halftone image quality. Hence, a 300 dpi machine with PhotoGrade provides 50% more visible shades than a standard 600 dpi machine. To use this in the Mac OS you must print a set of calibration sample pages via a utility and pick the best page. You then enter your choice, which allows the printer to use this calibration for all future printing.

FineGrade is a much simpler algorithm, available in some printers to smooth out the more jagged parts of text and graphics.

## TeX

TeX, pronounced as “tekh”, is a typesetting language devised by Professor Donald Knuth prior to the arrival of WYSIWYG word processors and modern PostScript DTP applications. Although originally designed for mathematical text and less common than PostScript, it can be used to create any kind of document. It employs a markup language in a text file, similar in some ways to HTML. Unlike HTML, however, it’s in a definitive form, ensuring compatibility between all documents and applications. In addition, it works as a proper programming language, making it closer to PostScript than HTML.

TeX also uses its own variety of fonts, allowing files to be used across different computer platforms. Textures (Blue Sky Research) is a TeX application for the Mac OS that includes PostScript versions of Knuth’s set of Computer Modern fonts, as well as the American Mathematical Society’s AMS TeX fonts. Unlike most TeX applications, where TeX-based fonts have to be used, Textures also lets you employ the standard TrueType and PostScript fonts found in the Mac OS.

Since TeX understands typography, good presentation is assured, although you can modify settings to suit your own requirements. Ligatures, horizontal and vertical spacing, positioning of titles, spaces between characters, margin widths and paragraph indents are all handled automatically.

### Creating a Tex Document

TeX originates from the Unix platform, which means that numerous different programs are used for each task in the creation of a document. In most instances, you must first create and edit the TeX material in a text editor and then save the result as a text file with a .tex filename extension.

• Creating a standard document in TeX is fairly easy, since formatting is automatic, although producing unusual layouts can be more difficult than with a WYSIWYG program.

Here’s an example of what you might see inside a .tex document, in this case taken from the manual for Excalibur (Rick Zaccone), a spell-checking application designed for use with LaTeX (see below):-

\pagenumbering{roman}

\tableofcontents

\clearpage

\pagenumbering{arabic}

\section{Introduction}

\ex{} is a Macintosh spelling checker. It will spell check documents

created by any text editor such as \texttt{BBEdit}, \texttt{Alpha},

\texttt{Emacs} or \texttt{MPW}. It will also spell check the

clipboard, making it a useful spelling checker for mail programs such

as \texttt{Eudora} and news readers such as \texttt{NewsWatcher}. It

will also work with any word processing program that supports

\htmlref{Word Services}{sec:word-services}

\begin{latexonly}

(section~\ref{sec:word-services} on

page~\pageref{sec:word-services})

\end{latexonly}

such as AppleWorks (formerly ClarisWorks) or WordPerfect.

This may look difficult, but some things are easier to do than in a macro of a word processor. For example, you can use a definition construct, such as:-

\def{WYSIWYG}{An acronym for What You See Is What You Get}

to specify the name of a term and its definition. A \def macro can also set layout, font, font style and other details that can be varied to suit different publications. Similarly, the appearance of items in a list can be easily changed. Normally, each item in a list begins with \item and TeX automatically puts a suitable symbol at the start of the item, usually a bullet. However, if you want an item to begin with a + you would enter \item[+], or if you wanted a - you would type \item[-].

Simply typing & has a similar effect to the tab stop in a word processor, automatically giving the text an appropriate alignment. Other things aren’t so easy, such as quotation marks, which must be entered as  for double opening marks or '' for double closing marks.

• You can speed up the creation of TeX documents by using the text macro utility known as TypeIt4Me (Riccardo Ettore) and the FasTeX collection of associated shortcuts.

### Typesetting

The process of rendering a .tex file into its final form is known as typesetting. This usually involves running the file through your chosen TeX application, which then creates a DVI (Device Independent) file, this being identified by the standard .dvi filename extension.

• The typesetting process is similar to converting a PostScript text file into a PDF. The DVI file can be viewed using a DVI viewer application, similar in some ways to Acrobat Reader.
• A free version of Textures Reader is available for viewing DVI documents.

A DVI document can be converted to PostScript using the dvi2ps utility and then printed on a PostScript printer. However, corrections can only be applied to the .tex file and the process repeated: this aspect of document creation makes TeX inconvenient to use.

Some applications, such as Textures, have the main TeX utilities built-in, including a text editor and previewer. This program also incorporates a typeset window, avoiding the need to convert to DVI — and with Flash Mode enabled you can see the result being updated as you type. Here’s an example of a mathematical equation, created using TeX and then viewed in a typeset window:-

###### Extensions to TeX

Since TeX is a programming language, it can be easily customised or extended by means of special packages. Typically, these can help you create particular types of documents or to place graphics within your work.

The most common package is LaTeX, introduced in 1985, and also known as Layout TeX or Layman’s TeX. It consists of a collection of macros and formats that simplify the process of creating formatted documents and is particularly good for creating footnotes, cross references, various heading levels, lists and quotations.

• LaTeX documents must be typeset twice to create cross references and tables of contents.

TeX and LaTeX include commands that let you incorporate graphics into a document, usually in the form of PostScript or EPS images. The Textures application also lets you include PICT images, as used in the Classic Mac OS, although such pictures can only be typeset on a Mac OS machine. This particular programme doesn’t include a PostScript rasteriser, so you can’t actually see the image in a typeset window, although it’s reproduced correctly on a PostScript printer. However, you should be able to see the PICT preview images provided with some EPS files in such a window.

## Inside a DTP Application

DTP programs are similar to a vector-based drawing application. However, instead of objects, each document or layout contains one or more frames. These can be text frames or graphic frames. As in a drawing application, these items can be resized, moved or rotated.

The working environment is often in the form of a pasteboard. The centre of this area is occupied by the page (or pages) that you’re currently working on, shown complete with margins. To create a frame you click on the appropriate tool and then click and drag to create a box of the required size.

Traditionally, DTP applications have a separate story editor window for creating textual material. Once you’ve finished editing in this window you can flow the contents into a frame. If the text is too long for a single frame you can link it to a second frame and flow the text across both of them.

• Older applications have a limited ability to edit text styles in the story editor window.
• Copying or pasting styled text between a PostScript application and a non-PostScript programme can result in a loss of styling information. In some Classic Mac OS programs you can convert PostScript text into QuickDraw styled text by pressing the Option key whilst selecting Copy.

The content of a graphic frame can be embedded in the document or linked to a separate graphics file, usually in the form of an EPSF or TIFF document. Embedded graphics ensure that the images are always in the file, although this can make a DTP document very large. Linked graphics don’t make the file any bigger, although such graphics are lost if the original files are deleted or relocated.

PostScript in its original form can’t print transparent objects, so all images are opaque, hiding what’s in the background. Fortunately, many applications get around this by using a lens tool or transparency tool that renders the transparent object and uses this to create new PostScript object.

• DTP applications usually support a range of plug-ins that provide additional features. For example, QuarkXPress uses a kind of plug-in known as an Xtension whilst PageMaker (Adobe) and InDesign (Adobe) use their own variety of plug-in known as an Addition.

## DTP Files

Numerous file formats are used, many of which are only recognised by their parent applications. The following section only provides information on PostScript-based files and other generic documents, together with their filename extensions and Classic Mac OS type codes.

### Device Independent (DVI) File  .dvi  ODVI

A special file, similar in some respects to a PDF (see below), which is produced when a TeX document is typeset. A special viewer is required to see the material, or it can be converted into a PostScript file by means of the dvi2ps utility.

### Encapsulated PostScript File (EPSF)  .eps/.epsf  EPSF

This kind of file is similar to a PostScript file, although the instructions aren’t in the familiar form of the PostScript language. According to the Adobe Redbook and EPSF 3.0 standards, an EPSF should be an ASCII text file, ensuring compatibility with all applications. However, a binary file is more compact than an ASCII file and is acceptable to most RIPs and servers.

EPSFs can contain PostScript data, as well as extra information, for elements such as vector images, bitmap images or document pages, the latter usually containing both text and graphics.

• Not all applications can open every type of EPSF.
• Before printing an EPSF, check that the necessary fonts are in the printer or on your computer. If not, include them in the EPSF or download them to the printer, but don’t send fonts in an EPSF to others, as this breaks copyright laws.
• The content of each page in an EPSF document is dependent on information in preceding pages. This means that an individual page can’t be extracted without losing layout information.
• A Desktop Colour Separation (DCS) file is a variety of EPSF that presents an image in a form that’s separated into its different colour components.
###### Vector Images

This kind of image is usually stored in an EPSF in PostScript form, although QuickDraw commands can also be used. This form of data is suitable for monochrome line art or where 256 colours or less are used. Typically, such material is computer-generated and takes very little memory or disk space.

• A vector image in an EPSF is invariably turned into a image if opened in a PostScript-based painting application. Similarly, some file translators convert all images into bitmaps or only accept EPSFs that contain bitmap images.

#### Bitmap Images

A bitmap is stored within an EPSF as TIFF data, although the data itself is enclosed in an EPS wrapper. Monochrome, greyscale, RGB or CMYK encoding can be used.

• An EPSF placed in a DTP application appears more quickly on the screen than a TIFF file.
• Although TIFF files support colour management, ensuring consistent colours on different devices, an EPSF provides an unmanaged preview on every monitor. However, EPSFs can convey extra data, such as dot shapes and screen frequency.
• When you crop the image from a TIFF file in a PostScript application, only the cropped portion is sent to your printer, ensuring rapid operation. However, if you crop an EPSF picture, the entire image is sent to your printer, which takes longer for the RIP to process.
• The bitmaps in an EPSF are sometimes compressed using JPEG compression.

A screen shot incorporated into a PDF (see below) can look blurry if it’s created using TIFFs. To avoid this problem, first capture your image via a suitable utility and then copy it into a bitmap application such as Photoshop. Then export it as an EPSF, using the following options:-

Encoding: Binary

Include Halftone Screen: Off

Include Transfer Function: Off

PostScript Colour Management: On

Image interpolation: On
###### Placing and Importing EPSFs

Some EPSFs contain a header that indicates the dimensions of the material within the file and how it’s to be placed in a final document. The process of placing an EPSF is assisted by the provision of a preview image within the file itself. Although the quality of a preview is often poor, it’s usually adequate for the job and doesn’t demand too much of the recipient application’s memory

• An EPSF can be placed, and scaled or rotated, in another page without the receiving application knowing anything about the file’s contents. In fact, many applications used for placing an EPSF are unsuitable for modifying this kind of file. However, the final document can be sent to a PostScript-compatible printer and usually gives a perfect result.
• Applications that can import EPSFs can usually be used to edit the content of the file. Unfortunately, some programs that appear to have this ability can only place EPSFs, while other can only import Illustrator files. The latter, which have a Classic Mac OS type code of EPSF and a creator code of ART3, are actually a simplified form of EPSF. If necessary, you can use a utility such as epsConverter to convert EPSFs into Illustrator files.
• EPSFs often have a PostScript showpage command at the end of the file, which lets you print the content before it’s embedded into another document. Once embedded, this command is disregarded. Many applications automatically add this command to the end of all EPSFs.
###### EPSF Preview Images

As already mentioned, an EPSF may include a low resolution preview image to assist in the placing of the picture. This gives you some idea of the final result without having to load the entire document into RAM. Any EPSF that’s lacking a preview image appears as a plain box when placed in a DTP application. This white or grey box often contains the name of the EPSF, as well as other details.

There are three kinds of preview in common use, detailed as follows:-

Preview TypePlatformFile ExtNotes
PICTClassic Mac OS.epsfPICT in resource fork with ID of 256
TIFFWindows.epsPreview before or after EPS code
WMFWindows.epsPreview before or after EPS code
EPSIWindows.txtPreview as hex dump in PostScript comment

A PICT preview, as used in the Classic Mac OS, is stored in a separate file known as a resource fork, the image itself being in the form of a PICT resource with an ID of 256, whilst the actual EPS data is kept in the main file, also known as the data fork. The preview image, as well as anything else in the resource fork, is lost whenever the parent EPSF is transferred to another computer platform. Fortunately, EPSFs can have a TIFF, WMF or EPSI preview as well as a PICT preview.

• PICT previews used for PostScript applications shouldn’t be confused with the previews provided for file Open dialogues within the Classic Mac OS. The latter are also a PICT resource, but have an ID of 29876 and work in conjunction with a pnot resource. Fortunately, these resources can coexist with any of the PostScript preview formats.

Here are some other points worth noting:-

• TIFF or WMF preview data is in the same form as a standard TIFF or WMF bitmap file.
• An EPSI preview is also known as an in-line data preview.
• Not all applications understand all types of previews. For example, RagTime, a DTP application for the Classic Mac OS, accepts PICT or TIFF previews, but not EPSIs.

### Portable Document Format (PDF)  .pdf  PDF<space>

This format, derived from the original form of PostScript, is often used for full-resolution DTP documents, as well as for images generated in Mac OS X. PDFs can be created Mac OS X using the Save as PDF option in standard Print dialogues. The resultant file can then be viewed in Apple’s Preview application or in Adobe Reader (Adobe), formerly known as Acrobat Reader. You can also use your Web browser in conjunction with a suitable version of the PDFViewer plug-in, as supplied with Acrobat Reader.

In the Classic Mac OS, you can use the full version of Acrobat (Adobe) or PrintToPDF (James W Walker) to make PDFs. You can also create them from PostScript documents by using GhostScript (Aladdin) or from within a BBEdit text file by means of PDF-Blit (Kas Thomas). You must use Acrobat Reader to view PDFs in the Classic Mac OS.

• Selecting Save as PDF in the Print dialogue for a PDF in the Preview application creates an unprotected copy of the file. Preview can also be used to export documents in a wide range of graphics formats.
• The PDFs produced by Mac OS X are particularly large, especially if they contain pictures. Fortunately, you can use an application such as PdfCompress (Metaobject) to reduce them to one-tenth of their original size, or even less.
• Apple’s ColorSync utility (in /Applications/Utilities/ in Mac OS X) can also be used to reduce the size of a PDF. Simply choose a filter and adjust the JPEG compression that’s to be used for the images within the file.
• PDFs are page-orientated, which means that an individual page can be extracted from a document without fear of losing any useful layout information.
• PDFs above version 1.2 can contain material suitable for printing on devices containing a high-quality RIP or with a multiple-RIP device.
• Some PDF documents incorporate a Job Definition Format (JDF) job ticket, written using XML, which sets the options for processing a print file.
• If you open a PDF in a text editor you’ll find that it begins with %PDF.
###### The Acrobat Package

Adobe’s full Acrobat package, which includes the Acrobat Distiller application, lets you:-

• Combine material from various applications or scanned documents into a single PDF.
• Automatically convert material from HTML documents.
• Use lossy or lossless compression to suit a particular computer platform or media.
• Include embedded fonts for computers or terminals that don’t have the required fonts.
• Use mark-ups in the form of annotations, highlighting, underlining, pencil tool or stamps.
###### Compatibility

The following problems can be encountered:-

• Some of the more recent PDF formats may be unacceptable to your recipients (see below).
• In some instances, you won’t be able to convert a PostScript file into a PDF
• Colour and layout fidelity may not be exactly perfect.
• Editing of non-Unicode fonts can be a problem.
###### PDF Variations

In many ways, PDFs are rather too flexible, resulting in complications when material is sent away for printing. For this reason, the PDF/X standard has been introduced, imposing much stricter rules on the content of PDF files. The following variations of PDF/X can be encountered:-

###### PDF/X-1

This is the original form of PDF/X, as defined by the Committee for Graphics Arts Technical Standards (CGAT) and ANSI, endorsed by the ISO and commonly used in North America. It prevents several options, including the use of RGB graphics or the omission of embedded fonts. In addition, all embedded graphics must be provided in DCS, EPS, TIFF or TIFF/IT format.

###### PDF/X-1a

An even stricter variation of PDF/X-1, in which all graphics must be supplied in the form of a PDF.

###### PDF/X-2

A looser form of PDF/X-1 that allows embedded fonts to be omitted. It also lets you use low-resolution graphics that can be replaced by higher quality images at the time of printing.

###### PDF/X-3

Similar to PDF/X-1, as commonly used in Europe. This standard also accommodates LAB and other colour coding systems that are independent of printers and display devices.

### PostScript File  .ps/.txt/.text  TEXT

This is an ASCII text file containing instructions in the PostScript language. Most modern DTP applications use EPS files or PDFs (see below) in preference to this kind of document.

• Not every application can open all types of PostScript file.
• PostScript documents can be opened or converted to another format using GhostScript (Aladdin). In some instances, you can open the file in a graphics application such as Illustrator or FreeHand and then convert it to a PICT, TIFF or EPSF document. PostScript files can be used on any computer platform and are even understood by some human beings!
• The content of each page in a PostScript document is dependent on information in preceding pages. This means that an individual page can’t be extracted without losing layout information.
• A PostScript file can only be printed on a multiple-RIP device if it conforms to the Document Structuring Convention (DSC), a page-independent variety of PostScript.
###### Creating PostScript Files in the Classic Mac OS

A PostScript file can be made in any application as follows:-

• Open the Chooser and select LaserWriter 8. Although a dialogue appears indicating that AppleTalk must be enabled, you can actually turn it off again and still use the printer driver.
• Choose File ➡ Print: if you get a warning about page margins you should adjust these first. In the Print dialogue set Destination to File and choose the following options in the Save as File window, selected from the main popup menu:-

PostScript Job

PostScript Level: Level 1 Compatible

Data Format: ASCII

Font Inclusion: None

EPSFs that include fonts can be very large. For example, a 12 KB file containing one character can expand to over 400 KB with fonts. However, fonts must be included to use the file on a computer that doesn’t actually have them.

If you use the above method you’ll find that the resulting PostScript file has a creator code of vrgd. When you double-click such a document, the Classic Mac OS presents you with a dialogue, letting you choose from all the applications that can open standard text files, even though most of these programs don’t understand PostScript. However, if you have Acrobat Distiller (Adobe) you can use this package to convert your file into a PDF (see below), which can then be read by Acrobat Reader. Later versions of Mac OS X can also convert PostScript files to PDFs by double-clicking the files.

A PostScript file can be downloaded at any time to a PostScript printer. In the Classic Mac OS you can use the Apple Printer Utility or the older LaserWriter Utility. Remember, the file may, or may not, contain the necessary fonts for printing.

### TeX File  .tex  TEXT

A standard text file containing TeX language instructions. Before printing, such a document must be typeset, which is achieved by converting it into a DVI file (see above).

### Reference

Comprehensive TeX Archive Network website at www.ctan.org

MacWorld magazine (UK), IDG Communications, 2003-2004

TeX Articles, ATPM, Michael Tsai, 1998