Monday, November 26, 2007

Which of Pages' methods to create PDF files should I use?

If you prioritize a small file, use Share > Export > PDF (Good) or PDF (Better). "Good" means roughly 72 dpi for the embedded images. "Better" means roughly 150 dpi. Images will lose quality, but it should be acceptable for display on a computer screen.

If you prioritize high quality graphics, use Print > PDF > Save to PDF or Share > Export > PDF (Best). These two methods seem virtually identical. Graphics included in the document keep the original quality and resolution.

There is no difference between any of the methods for text and inserted shapes. They are vector graphics and keep their infinite resolution.

If you will send the PDF off for professional printing you can try one of two options.
  • Print to PDF/X. This is supposed to produce a file with colour profiles that a printer can handle correctly. See further information.
  • Print to PostScript and then convert the postscript file to PDF - preferably using Adobe Acrobat. In some (or all?) cases this produces a file that is easier to colour separate. See further information.
(Note: The "Share" menu mentioned above was called "File" before Pages '09.)

For information about some of the features that Pages supports in PDF files, see this post.


On the left a 300% view of a picture scaled to fit one square inch in Pages. In the middle, the same Pages file exported as "Good" PDF. The loss of quality is clearly visible at 300% magnification. To the right is the result of a "Preflight" in Adobe Acrobat. The image dimensions are 73/73 pixels.

Thursday, November 22, 2007

EGWORD (removed article)

The comparison with Egword is removed, as Egword no longer exists as an application. For those who are curious, the comparison is still available here.

Sunday, November 11, 2007

Helvetica Narrow problems

With Mac OS X 10.5, Leopard, some users report problems with Helvetica Narrow appearing as substitute font for Helvetica. There are couple of things you can try to fix the problem.

* The obvious thing is to delete Helvetica Narrow. Also look for "N Helvetica Narrow", which may be stored in one of the font folders. Spotlight search for the fonts, to be sure to find all instances.

* Disable Helvetica Narrow. That seems to have worked for some people, but not for everyone.

* Install Helvetica a second time, but this time to your User library or /Library/Fonts. You can find the font using Spotlight. Drag it to your User library or /Library/Fonts or use Font Book. If you get a warning about a conflict, choose "Allow Conflict". (This is not a very clean solution, but it has worked for some people.)

* Disable all your User fonts - just in case.

* Remove all System 9 fonts from /Library/Fonts. You can recognise them as they appear with a size of zero.


For other font problems and suggested solutions see deleting font cache and missing fonts.

Update 29 May 2008: The updated version of Mac OS X, 10.5.3, is said to fix the Helvetica Narrow problem.

How do I import a LAB image to Pages?

CIELAB colours are mostly used to edit pictures, but in some cases one might want to include an image that uses the LAB colour space to Pages.

Pages 3.0 usually imports Photoshop PSD files, but for some reason, it fails with PSD files using LAB colour space.

The solution is to save the image as TIFF. It maintains the colour space and it displays fine in Pages.

There is one restriction however: Instant Alpha does not work on imported LAB TIFF files. The solution is to add transparency in the TIFF file itself before import.

Tuesday, November 06, 2007

Which are the document types used by Pages in Applescript?

The document types used by Pages under Mac OS X 10.5 (Leopard) are defined in the Pages package Content/Info.plist under the tags CFBundleDocumentTypes > [a number] > CFBundleTypeName. They are the following ones:
  • SLDocumentTypeRichText
  • SLDocumentTypeRichTextBundle (rtfd)
  • SLDocumentTypePlainText
  • SLDocumentTypeSimpleText
  • SLDocumentTypeMSWord
  • SLDocumentTypePDF
  • SLDocumentTypeAppleWorks
Not all of them can be used in Applescript to export documents. There are the same limitations as for Export using the Share > Export dialogue. To see how they can be used, see this example.

My fonts in Leopard are crazy. How do I reset the font cache?

In the best of all possible worlds, you should never have to reset the font cache, but Leopard (Mac OS X 10.5) seems to have some stability issues with fonts, which sometimes appear missing, even though you can see them in Font Book. If you have serious font problems, you can try the following. It is (probably) risk free if you follow the instructions exactly, but if you do not follow them to the letter, you may damage something in your system.

Therefore you should only follow these instructions in two cases:
  • You understand them perfectly, and you know what they are doing.
  • You are desperate because of some font problems.
Here are the steps:
1. Open Terminal.
2. Type the following two commands:
cd `getconf DARWIN_USER_CACHE_DIR`
open ..
3. In the Finder window that appears, drag the folders -Caches-, -Tmp- and TemporaryItems to the Trash, if they exist.
4. Restart. You may get a message that the boot cache is being rebuilt.

Once you have restarted, your font problem may be gone.

For other font problems, see missing fonts and Helvetica Narrow.

Saturday, October 13, 2007

How do I change all red text to blue?

If you have applied the same colour in a lot of places in a document and want to change them all at once, you can run the following AppleScripts.

First you want to know the code of the colour you have. Put the cursor in a coloured word and run this script in Applications > AppleScript > Script Editor.

tell application "Pages"
tell front document
set S to selection
tell body text
set C to color of character before S
display dialog (((item 1 of C) as text) & ", " & ((item 2 of C) as text) & ", " & ((item 3 of C) as text))
end tell
end tell
end tell

Then run the following AppleScript, after you have changed the example colours to the ones you found running the previous script:

tell application "Pages"
repeat with achar in characters of body text of front document
if color of achar = {53355, 23, 54} then
set color of achar to {23, 54, 53355}
end if
end repeat
end tell

How do I use an image to fill text?

There is no built in way of doing it, but if you have some time it is possible using Preview:
  1. Insert the fill picture to Pages.
  2. Create a text box with the text you want. Use black text.
  3. Copy the text box.
  4. Open Preview and select File > New from Clipboard.
  5. Save the image as jpeg (to get rid of the transparency of the background).
  6. Copy the image from Preview.
  7. Paste it into Pages.
  8. Position the fill image behind the pasted picture.
  9. Use Format > Instant Alpha to make the text transparent, and the image will be visible through it.

Wednesday, October 10, 2007

Where are the templates stored? Where are the example pictures?

The template images are well hidden in the Pages application package. Right-click on it and select Show Package Contents. Go to Resources > Templates. Each of the template is a package in itself. Right-click on each and select show Package contents, and you will be able to find the pictures. You can copy them from there, but do not remove them, or you will destroy the templates.

If you create templates yourself, they will by default be stored in your home directory: ~/Library/Application Support/iWork/Pages/Templates/My Templates.

Why were Pages documents directories and not files?

Before Pages '09, Pages files were "packages" instead of files. There were some good reasons for that, but also a lot of inconveniences.

MacOS X is full of "packages" which in fact are directories.

Almost all MacOS X applications, including iTunes, Adobe Photoshop and NeoOffice are all packages. This makes it easy for developers to add and remove components and to see what files are included and what can be changed and needs to be improved. It also makes it easy to include a lot of information, which otherwise might have been spread over many files.

The main applications of MS Office 2004 are not based on packages. MS Office contains thousands of files. iWork '08 contains only 3 visible files: Keynote, Numbers and Pages.

So much for applications. But why use packages for documents?

The same reason. It is simpler. One can easily open the package of a Pages file and see what it contains if needed. If a picture does not display correctly, one can open the package and verify that the image file is there and that it works.


The drawback is that the files are difficult to attach to mails using webmail. But it takes just a right click to zip the file, and then it becomes both small and easy to attach.

How can I set the Multilingual dictionary as default?

You create a new template, change the language of all the styles to "All", save the template, and in the Preferences, choose this template as default for new documents.

Where is the "Multilingual" spelling dictionary?

When TextEdit's spelling module talks about a "multilingual" dictionary, Pages' spelling module simply says "All". To use it, go to the Inspector > T (for Text) > More and choose "All" as language.

How do I remove words from the spelling dictionary?

If you accidentally add a word to the spelling dictionary, you can remove it by opening the spelling dialogue (Edit > Spelling > Spelling...), typing the word, and clicking on the "Forget" button.

How do I change the default font?

If you are not happy with the default font in Pages' templates, you can correct it by changing the styles in the template and saving it. Then go to Preferences and select the changed template as default for new documents.

Is there a Pages Viewer for Windows?

No.

If you only have a Pages document and a Windows PC, it is very difficult to see the Pages document as the author intended it. You have only two options:

1. Get a Mac with Pages, or call the original creator of the document and have the Pages document saved in a format that can be read on Windows. That usually means Word or PDF. If you want to edit the document on Windows, only Word or RTF formats work. RTF files with images and tables are not supported.

2. If the file was saved as a package, you can look at the files inside the Pages document directory and try to make something out of the different pictures and xml files that are there. You may at least get an idea what the document is about. If the author set the checkbox "Include preview in document", when the file was originally saved, this may work out reasonably well.

If you want to see what the Windows user will see in a Pages document you can control-click on the file in the Finder and Show Package contents.



You will see the included images and other files in their directory structure. If you clicked the checkbox "Include preview in document" when you saved the file, you will even get a PDF file with all the text and some very compressed pictures in the QuickLook folder.



Anyhow, there is currently only one application that can open Pages files, and that is Pages.

(The situation is the same for Numbers and Keynote documents. There is no available reader for Windows.)