Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts

Tuesday, April 27, 2010

Pages for iPad cannot create usable PDF files

Some PDF files from Pages for iPad are distorted or unreadable when opened in Adobe Reader. They display much better in Preview, but as Windows users do not have Preview, this is not much of consolation. You can follow this thread to see other people having the same problem. If Apple releases a fix, the thread is likely to be updated by happy users.

There seem to be some dependency on which fonts are used. Trying out most of the fonts installed on my iPad, hardly anyone displayed correctly in Adobe Reader. However, all except Heiti and Zapfino were readable. Heiti and Zapfino displayed as dots: ••••


One font actually displayed as it should, and that was Apple Gothic. It is a mystery why that one of all fonts worked.

Most other fonts displayed as Adobe Sans MM. To get a consistent layout, you can try using Arial or Helvetica in Pages for iPad, as they also are sans serif fonts. You can also try Apple Gothic.

It is nevertheless good to validate the file in Adobe Reader. The final display may depend on your system or the layout of the document.


A list of embedded fonts in Adobe Reader. File > Properties > Fonts.

Saturday, January 31, 2009

PDF/X Problems in Leopard

With Mac OS X 10.5 (Leopard) some people got problems printing PDF/X files. It seems the people who did not get problems did not print complicated documents.


Problem one - some documents. Certain documents, like the Pages '09 template Word Processing > Reports > Visual Report simply refuses to create any document. You can choose the menu item in the Print dialogue, you can enter a file name, but then you get a message: "Alert Couldn't create PDF/X-3 document."


Problem two - resolution. This limitation was likely here even before Leopard, but it is worth mentioning. PDF/X-3 does not support layers, and that means that the PDF/X-creator has to rasterise vector graphics over pictures, like text over shadows. The problem is that Mac OS X rasterizes to 72 dpi, and that is no way good enough for printing on most modern high resolution printers.

The resolution is defined in a Filter in ColorSync (Applications > Utilities > ColorSync Utility). Go to Filters and check the properties for "Create Generic PDFX-3 Document". The resolution is defined next to the "Flatten Transparency" checkbox. The annoying thing is that the Filter is read only, so we cannot change the resolution.


What we can do, is to create a copy of the original Filter and change the value there. (Do not try to change the values for Trimbox or Bleedbox. I do not know anyone who has made them work.)

Next, is something you should NOT do. The entry in the Print dialogue to print to PDF-X is defined in /Library/PDF Services. Do not be tempted to change any of those entries. You will get a warning message saying: The behavior of this workflow may have changed because of the reasons listed below. The workflow was saved with an older version of the action "Apply Qua... If you try to resave it, you may break it and stand with one less working entry in the Print dialogue.

Instead, to solve the resolution problem, follow the following steps.

Setup
  1. Open ColorSync.
  2. Go to Filters.
  3. Click on the circled triangle next to the filter Create Generic PDFX-3 Document and select the option "Duplicate".
  4. Double click on the name of the new filter and change the name, if you want to.
  5. Expand the filter elements and change the resolution to 300 and 300. You do not need to save the changes, but you may want to quit ColorSync and reopen it, to make sure that the change has been taken into account.


Usage
  1. Open the document you want to make into PDF/X.
  2. Print to PDF (standard PDF).
  3. Right click or control click on the created PDF file and select Open With > ColorSync Utility from the pop up menu.
  4. In the document window in ColorSync select the filter you created above from the list in the bottom left corner of the window.
  5. Click on Apply. (The Filter list will be reset to "None" through some quirk, but do not let that scare you.)
  6. Select Save or Save As... from the File menu. You will now have a high resolution PDF/X file. Probably.
Warning: The error handling in ColorSync is abysmal. If you have too complicated a file - for example one that would not even allow you create a low resolution PDF/X file from the Print dialogue, then the resulting file may not be compliant with PDF/X even after the ColorSync treatment. The only way I know of verifying this for sure, is to open the file in Adobe Acrobat and do a "preflight".

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.)

Sunday, March 23, 2008

Print shops and embedded fonts

With some print shops you may get an error back saying something like "This file was created with Mac OS X 10.4.11 Quartz PDFContext / Pages. We cannot print files created with this application."

Mac OS X embeds several subsets of the same font, just like many other applications. However, for some reason some printers (like Lulu) are not able to handle the way Mac OS X does it.

A solution that in some cases works is to create the PDF using Print > PDF > Print to PDF-X. In contrast to a standard PDF, which can be used for many purposes, a PDF-X file is dedicated to facilitate printing.

You can find some more information at the following sites:

Wednesday, January 30, 2008

Export folder to Word, RTF, PDF, TXT or RTFD

This AppleScript to export the content of a folder with Pages documents was kindly created by Yvan Koenig. You can find more of his scripts at his Public iDisk. If you prefer to export a selection of files, you may want to have a look at the scripts in this post, which use a Scriptlet.

To use the script below, copy it all into a new script in ScriptEditor and run. Due to blogspot's layout, you may not see all characters here, but they should be copied properly, if you highlight all the non-proportional text below.
(*
Export pages documents as Word ones in the folder where the original docs where.

Assuming that we start with:
AppleScript & Office.pages
it will be exported as:
AppleScript & Office.doc
If a file already exist with the short name
it may be saved as:
AppleScript & Office#20080128T221639.doc (if withSeconds is defined as true)
AppleScript & Office#20080128T2219.doc (if withSeconds is defined as false)

the serial number is a packed version of the date/time of the save process:

2008/01/28T22:16:39 or 2008/01/28T22:16

Thanks to Dale GILLARD who teach me the way to export without using GUI scripting.

Yvan KOENIG
28 janvier 2008
29 janvier 2008
*)

property withSeconds : false (* you may set it to true if you wish *)
property typeNum : 1 (* 1 = WORD, 2 = PDF, 3 = Txt, 4 = rtf, 5 = rtfd *)

property newExt : ""
property newType : ""
property types : {{"doc", "SLDocumentTypeMSWord"}, {"pdf", "SLDocumentTypePDF"}, {"txt", "SLDocumentTypePlainText"}, {"rtf", "SLDocumentTypeRichText"}, {"rtfd", "SLDocumentTypeRichTextBundle"}}

tell application "Finder" to set listeFichiers to every item in (choose folder) (*
dans un bloc Finder pour avoir un titre de dialogue "localisé"
• in a Finder block to get a localized dialog title. *)
if (count of listeFichiers) = 0 then return
open listeFichiers

-- ===========

on open (sel)
repeat with elem in sel
my exploreTraite(elem as alias, "")
end repeat
end open

-- ===========

on exploreTraite(elem, ptree) (*
elem est un alias
elem is an alias *)
local elem_, cl_, typeId_
set elem_ to elem as text
tell application "System Events"
set cl_ to class of item elem_
set typeId_ to type identifier of elem
end tell
set cl_ to cl_ as Unicode text

if cl_ is "file package" then
if typeId_ is "com.apple.iwork.pages.pages" then my TraiteUnPackage(elem_, ptree)
else if cl_ is "folder" then
my ExploreUnDossier(elem_, ptree)
else
-- not for us
end if -- cl_ is …
end exploreTraite

-- ===========

on ExploreUnDossier(dossier, ptree)
local nomElement, cheminElement, c
repeat with nomElement in list folder dossier without invisibles
set cheminElement to dossier & nomElement
tell application "Finder" to set c to name of (dossier as alias)
my exploreTraite(cheminElement as alias, ptree & c & ":")
end repeat
end ExploreUnDossier

-- ===========

on TraiteUnPackage(aPackage, ptree)
local docPathAndName, oldName, docName, newExt, newType
(* aPackage always ends with a colon, we must remove it *)
set aPackage to (text 1 thru -2 of (aPackage as Unicode text)) as alias

set {newExt, newType} to types's item typeNum
tell application "Finder"
set sourceFolder to (container of aPackage) as Unicode text
set oldName to name of aPackage as Unicode text
end tell -- Finder
set docName to (text 1 thru -6 of oldName) & newExt
set docPathAndName to sourceFolder & docName

tell application "System Events"
if exists file docPathAndName then
set docName to (text 1 thru -7 of oldName) & my serialize() & "." & newExt
set docPathAndName to sourceFolder & docName
end if
end tell -- system events

tell application "Pages"
open aPackage
save front document as newType in docPathAndName
close front document
end tell -- Pages
end TraiteUnPackage

-- =============

on serialize()
local cd, serial
set cd to current date
set serial to (year of cd as text) & text -2 thru -1 of ("0" & (month of cd as number)) & text -2 thru -1 of ("0" & day of cd) & "T" & text -2 thru -1 of ("0" & hours of cd) & text -2 thru -1 of ("0" & minutes of cd)
if withSeconds then
return "#" & serial & text -2 thru -1 of ("0" & seconds of cd)
else
return "#" & serial
end if
end serialize

Wednesday, January 16, 2008

How do I compress images in Pages?

You cannot.

Any image you import to Pages stays its original quality and size to allow print outs and exported PDF files to be as good as possible.

If you really want to save space, you have to compress the original image file in an external graphics editor, like iPhoto, Photoshop, Aperture, the gimp, or many others. This is not the place to evaluate which one is best, but there is a list of some possible ones at Wikipedia.

Even though you cannot compress the images within Pages, note that for the finished document, you can export a compressed PDF version from Pages using Share > Export. (Before Pages '09, the menu was File > Export.)

Sunday, January 13, 2008

Why can't I add Reflections or Adjust an Image?

The text below was written before Pages '09. With Pages '09, you can add reflections to shapes, but the other restrictions remain.

...

If you highlight an object and go to the Inspector > Graphic, it is possible that the Reflections checkbox is greyed out. And if you go to View > Show Adjust Image, it is possible that none of the controls work.

This may be because you
a) have not highlighted anything. (Make sure you clicked on the image.)
b) have highlighted something that is not an image. Images can for example be PNG, JPEG, GIF, TIFF with or without layers and transparency in CMYK, LAB or RGB colour space.

You cannot add reflections to inserted shapes (Insert > Shape > whatever), tables, text or charts, even though you can add shadows and change transparency for them. Neither can you use the Adjust Image window with them.

Reflections work only on images and PDF files you have inserted from elsewhere (for example with Insert > Choose... or drag-and-drop from the Finder).

Adjust Image only works on images but not on inserted PDF files.

Why does Pages have these limitations? It is because PDF files and inserted shapes are vector graphics. They have a completely different way of handling colours. Take for example the slider for "Sharpness". To apply sharpness to bitmap graphics, you simply change the surrounding pixels a little. However, for vector graphics, there is nothing called "surrounding pixels", to that kind of adjustment does not work.

The main problem here is not that Pages does not apply adjustments to vector graphics. The main problem is that it does not provide any user feedback why it cannot be done, and what the user can do to get around the problem.


In this image the left circle is a shape from Insert > Shape > Oval, so it does not accept reflections. The right circle is an image that was dragged onto the document from the Finder, so the reflection works fine.

Thursday, January 10, 2008

How do I exchange files InDesign, Publisher or other DTP applications?

There is no easy way to export a file from Pages so it can be opened by Desktop Publishing Applications like Adobe InDesign, Microsoft Publisher or Quark Express. Neither is there any elegant way to export from those applications so one can open the file in Pages.


Let's just look at InDesign as an example of the problems.

From Pages to InDesign

If you copy formatted text from Pages to InDesign, it will loose all the formatting - font, size, typeface and so on.

If you copy a Text Box from Pages to InDesign, it becomes a graphic. You can no longer correct spelling mistakes or change fonts.

If you copy an image with an alpha channel for transparency and the setting Wrap text to follow the contour of the object, and paste it to InDesign, it will be pasted correctly with a transparent part - however, you will have to set the wrap setting as you want it manually - for each image obviously.

From InDesign to Pages

If you copy formatted text from InDesign to Pages, it will keep part of the formatting, like font and size. However, some features that are not supported by Pages, like kerning, will obviously be discarded.

If you copy a Text Box from InDesign to Pages, it becomes a pdf graphic. You can no longer correct spelling mistakes or change fonts.

If you try to Select All in InDesign and copy it to Pages, it will become a non editable pdf graphic of that page.


Solution

If you have a document in the format of another dtp application and want to work on it in Pages instead, the only solution is often to manually copy and paste piece after piece, and then to correct the formatting that was lost.

However, if there is one page, which you want to create in another application, you can usually save it to PDF from that other application, and you can then paste or insert the PDF as a picture to Pages.

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.

Sunday, January 14, 2007

I generated a PDF file from Pages, and now I want to know if the images are RGB or CMYK. What do I do?

The only answer I have is expensive: get Adobe Acrobat Pro.

* Open the PDF in Adobe Acrobat Pro.
* Go to Advanced > Preflight.
* Highlight any profile, for example "List all images".
* Execute.

In the resulting window, expand the data for all image and check if it is CMYK or RGB.

Friday, December 22, 2006

How does Pages handle PDF-X files?

Pages does not handle PDF-X files at all, but MacOS X does through the standard print dialogue. There are some known problems with it - especially in Leopard, but if you have simple documents, it should work fine. Some of the problems are described here.

When MacOS X 10.4 prints to PDF-X it creates a PDF/X-3:2002 compliant file, probably regardless of the original content of the file. All fonts are embedded. RGB images without color calibration get a generic ICC profile called "Generic RGB Profile", if you generated the file from an English system. The file itself contains the specification of this profile. The ICC profile for an embedded image typically looks like this:
Profile version number: "2.2.0"
Color Management Module (CMM) type: "appl"
Profile/Device class signature: "mntr"
Color space of data: "RGB "
Profile Connection Space (PCS): "XYZ "
Magic number: "acsp"
Primary Platform: "Apple Computer, Inc. (APPL)"
Device manufacturer: "appl"
Device model: ""
Profile creator: "appl"
Creation date: "13/5/02 12:00"
Default rendering intent: Perceptual
Profile illuminant
- Illuminant X: 0.964203
- Illuminant Y: 1.000000
- Illuminant Z: 0.824905
Copyright information: "Copyright 2002 - 2003 Apple Computer Inc., all rights reserved."
Profile description: "Generic RGB Profile"
The output intent of the file is defined as "CGATS TR 001 SWOP". This basically means that it follows an agreed standard for printing with CMYK color space. CGATS is the Committee for Graphic Arts Technologies Standards. SWOP is an abbreviation for Specifications Web Offset Publications. Both organisations are American but the standard could be applied throughout the world.

To see more of this data go to Applications > Utilities > ColorSync Utility > Filters.

In theory, it should be possible to create your own Filter and apply them with Automator. The general idea is to take an existing workflow from /Library/PDF Services and copy it under another name to your own equivalent folder ~/Library/PDF Services. Edit the PDF service and data with Automator and give it a PDF file as input.

However, the process to create new filters is buggy, unless you know exactly which way to take. It was bad in Mac OS X 10.4 (Tiger) and it is not better in Mac OS 10.5 (Leopard). The I work in Pages blog has one process which is said to work. Again, there is a list of known problems and workarounds here.

When I print a document or save as PDF, Pages crashes. Why?

This can happen if you have inserted a footnote in the document and then removed the footnote text, but not the footnote itself.

Monday, December 11, 2006

How can I embed sounds or movies in a document for Windows users?

In Pages 3.0 you cannot. In Pages 2.0 there was a cumbersome and not elegant way to do it with HTML export.

Exporting to pdf or rtf will not embed movies or sounds.

Exporting to Word will link the movie/sound to the document, so it will play fine on your own computer. However, if you transfer it to another Mac, you will have to transfer the movie/sound as well as a separate file.

And even if you send both Word document and movie/sound to the Windows user as two separate files, it may not play on Windows. The help for MS Office 2004 for MacOS X says "Compatibility Report: Inserted QuickTime movies might not appear in Office for Windows."

What pdf features are supported in Pages?

When you create a pdf from Pages 3.0 in MacOS X 10.5 (Export or Print to PDF) it retains the following features:

* Hyperlinks defined in the Pages document
* Bookmarks defined in the Pages document
* Hyperlinks from the page numbers in the Table of Contents
* Scalable graphics stays scalable
* Transparency and shadows of graphics
* Well formatted unicode characters (like 日本)

It does not have any of the following features:

* Outlines (as a special side bar in Adobe Reader or Preview)
* Embedded media (sounds or movies)

Note that PDF/X files do not support any active content, like hyperlinks or bookmarks..

For advice about which method to use to create PDF files, see this entry.

Saturday, December 09, 2006

Why cannot Pages show pictures in .rtf files?

Part of the reason is that Pages is silly. If a picture is in a file, it should of course display it.

However, there is method in the madness. When it comes to rtf-files, Apple decided not to support pictures, as the rtf handling of images is too limited. Rtf supports only jpg pictures and png pictures and a number of "meta" image formats. This means that if you insert for example a small eps or pdf-file into an rtf document, MS Word will have to convert it to jpg or png, and then it is no longer scalable, even if you print on a printer with high resolution or with a large paper format. You can see this by simply increasing the view size in MS Word.

When an application like TextEdit saves to rtf, it instead uses rtfd, which allows for pdf and other high quality scalable formats.

If you open an rtfd from TextEdit in Pages the edges are still smooth with a high magnification. However, in any magnified rtf Word the edges of original PDF files are jagged.

So, Pages it not that silly after all? Oh, yes it is:

1. If a well formatted rtf file contains a picture, there is no excuse why Pages should not display it.
2. When Pages exports to rtf, it does not warn you that it is not going to export to rtf at all, but to rtfd, which no Windows application can read.
3. Not only that, the embedded picture in the rtfd file is not PDF! It is tiff, which is a rasterized bitmap format, so it still gets the jagged edges.




Saturday, November 04, 2006

How do I import more than one PDF page to Pages?

If you import a PDF document with more than one page, only the first one will be imported to Pages.

However, if you first open the PDF file in Preview, you can highlight page after page and copy them and then paste them into Pages. (This does not work on all PDF files. Some PDF files have security settings that prevent it.)

How do I edit PDF files with Pages?

You cannot. No application can make any substantial modifications to PDF files - not even Adobe Acrobat from Adobe, who created them. The main purpose of PDF files is to print them. PDF is the end station.

You can import PDF files, like you can import images, but you cannot open them.

You can extract data from some PDF files in a few different ways.

The most obvious one is to simply copy the content from the PDF to Pages.

In some cases you may want to keep the layout of the pictures, and in that case a screen shot may be better. To make a screen shot hold down command-shift-4 and drag the mouse over the area you want. If you want high resolution, you need to increase the zoom the PDF is displayed in.

If you use the free Adobe Reader, you can export the text using File > Save as Text. No formatting and no pictures will be exported.

If you invest in Adobe Acrobat Pro, you get some more export options: HTML, JPeg, RTF, Word document, XML and others, and the result is sometimes acceptable. There is even a menu option to export just the images: Advanced > Export all images.

If you export to RTF, remember that Pages cannot render pictures in RTF files, so you will have to open it in another application like MS Word or NeoOffice.

Also note that there are PDF files that are locked, so you cannot extract any data from those files with any legal program. This is often the case with e-books for example, but also other material where the authors want to protect their copyright.

How do I password protect a document?

From Pages '09, you set the password in the Document Inspector's Document pane.

In previous versions, you could not do it from Pages itself. The following describes ways to handle the problem with previous versions of Pages.

The safest way is to create an encrypted disk image using Applications > Utilities > Disk Utility, and put your document on that one. You get 128 bits encryption, which should be good enough for most purposes. Apple has more detailed instructions.

Using an encrypted disk image is more convenient than many people at first assume. It is high security. It is one password. And you can put a large number of different files on it (Pages, Numbers, pictures, mp3s...).

At first glance MS Word encryption seems simpler - just add a password to the document itself. However, it is not to be trusted. According to Microsoft themselves their passwords for file modification is not a security feature. It is a collaboration feature, and it can easily be hacked. According to Lastbit, no MS Office passwords before MS Office 2007 were secure. And with MS Office 2007, only the passwords for opening a document a document are safe.

From Pages you can get some kind of a Windows-compatible password protection by printing the document to PDF and encrypt it. However, neither you nor the reader will be able to easily modify the document. The encryption in the first versions of Leopard and earlier is just 40 bits RC4, which means it can be cracked with some patience. However, from Security Update 2008-002 (early 2008), the encryption is 128 bits RC4, which should be safe enough for most of us.

You could also use standard file system security (File > Get Info in the Finder), but any other user of the Mac with admin rights will be able to get to the file fairly easily. This kind of security is useless if you put the file on a memory stick or send it over the internet.

Also remember that no security mechanism is safer than the password you choose. If you choose "password" or the file name as password, it is easy for anyone to guess it and access the file content.