Wednesday, October 08, 2008

How do I get svg files into Pages?

SVG files are "images" which can be resized without losing any information. They can be created by programs like OpenOffice (the drawing module), Inkscape or Adobe Illustrator.

Often the program that created them can also save to PDF, which Pages handles directly, and that is then an easier solution.

However, there is a way to import black and white SVG files to Pages with the help of some other programs. It it may be cumbersome, the first time you set it up, and you will have to type commands in the Terminal, but it does work.
  1. Download the program svg2key and follow the corresponding instructions at http://mcb.berkeley.edu/labs/zusman/dave/svg2key/ .
  2. Run the program on the SVG you want to import to Pages.
  3. You will get a Keynote file. Open it in Keynote.
  4. Copy the content and paste it into Pages.
(Images are usually stored inside the Pages file "package" as separate objects. However SVG objects are stored inside the index.xml file in the package, just like "shapes", text and style information. As far as I can tell, they appear within the tags SFDBezierPathSource.)

Saturday, October 04, 2008

Which are my preferences?

If you have Pages running fine for one user on one computer, but you have problems on another, it is possible that the preferences are corrupted.

The quickest and dirtiest way to check this is to delete the preference file -homedirectory-/Library/Preferences/com.apple.iWork.Pages.

However, if you want to check for the exact difference in preferences between the two files you can follow the following steps.

  1. Launch the Terminal (Application > Utilities > Terminal).
  2. Type the command defaults read com.apple.iWork.Pages |less
  3. Hit enter.

You will now get a list of all preferences set for Pages for the active user. It will look something like this:


{
"AppleNavServices:PutFile:0:Disclosure" = <01>;
"AppleNavServices:PutFile:0:HomeDirectoryPath" = "file://~/Desktop/";
"AppleNavServices:PutFile:0:Path" = "file://localhost/Users/Magnus/Desktop/";
"AppleNavServices:PutFile:0:Position" = <01b201ba>;
and so on...


To move to the next page, press space. To move up one page, type b. To get more information about navigating around, press h. To leave the display to be able to type another command, type q.


Using the command defaults you can also change individual values, if needed.

Warning! When you change those values by hand, you may make things worse than they were before, unless you are careful. Make sure you know what you are doing. You can try the commands out in a test account, before you change things in the main account, if you are unsure.

Let's say that you are interested in the following preference:
MediaBrowserVisibility = 0;
You realise that means that the Media Browser is invisible in Pages. (It actually means that it is invisible by default, when Pages starts.) To change it to visible, you type the following text. The full line may not display well in your browser, but you can copy the line. When you paste it in Terminal, it will paste the full line.
defaults write com.apple.iWork.Pages MediaBrowserVisibility 1
Next time you open Pages the Media Browser will be visible.

defaults write com.apple.iWork.Pages MediaBrowserVisibility 0
And it will be invisible next time you open Pages.

Remember that you will have to close Pages and reopen it for it to take the changed values into account.