Adobe Illustrator and PDF Compatibility

Adobe Illustrator and PDF Compatibility

Published April 6, 2022

A question came up regarding how Adobe Illustrator and PDF files are related. After all, Illustrator files have a %PDF header and start out with XMP metadata syntax that suggests strongly that Illustrator files are PDF files. Also, Illustrator seems to default to saving files in a PDF-compatible mode. While in some cases Illustrator files can be processed like they are PDF files, it is important to note that they are not PDF files and the number of cases they can be treated like PDF files is very limited. 

Adobe Illustrator (here I’m using CS5, but this should apply to other recent versions also) offers users the choice of saving AI files as PDF compatible files in its Save dialog. Whether or not this option is selected, the resulting AI file begins like a PDF file and has a header indicating PDF compliance. An example of an Illustrator document saved with PDF compatibility turned off still looks remarkably like a PDF file:


 

[and so on]. You’d be readily forgiven for looking at this and assuming that this AI file is really a PDF file. Technically, the file is indeed a PDF file. However, all of its useful content and attributes is hidden inside Illustrator-specific data streams. Opening this file in Acrobat, one does not see what is expected at all. Instead, one gets one page with a repeated block of text:

 

This is an Adobe® Illustrator® File that was
saved without PDF Content.
To Place or open this file in other
applications, it should be re-saved from
Adobe Illustrator with the “Create PDF
Compatible File” option turned on. This
option is in the Illustrator Native Format
Options dialog box, which appears when
saving an Adobe Illustrator file using the
Save As command.

 

Some readers may have seen a very similar situation when opening up PDF files that are Dynamic XFA forms with a non-Reader, non-Acrobat PDF viewer: a file that claims to be a PDF and is in technical compliance with the PDF specification, but still completely useless and containing only some text that says the file is not useable.

Turning the “Create PDF Compatible File” option on and saving, one immediately notices that the Illustrator file that results is much larger than the Illustrator file saved without this option. The file that is generated starts off a lot like the previous version, but we can tell immediately there’s more to it:

%PDF-1.5 %âãÏÓ
 1 0 obj
 <</Metadata 2 0 R/OCProperties<</D<</ON[7 0 R]/Order 8 0 R/RBGroups[]>>/OCGs[7 0 R]>>/Pages 3 0 R/Type/Catalog>>
 endobj
 2 0 obj <</Length 58970/Subtype/XML/Type/Metadata>>stream
 <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>

[and so on]. Unlike the Illustrator file saved without PDF compatibility, there are some layer (optional content groups) present in the document catalog. Opening the AI file up in Reader or Acrobat, we see the file looks compatible: unlike the warning text from the other version, the page that is drawn looks like the Illustrator artboard this was saved from. In fact, the AI file generated is a PDF compatible file and contains a page that appears like our Illustrator file. However, the private Illustrator data streams are still present in the PDF file. This is because the Illustrator file is a PDF that’s not necessarily going to be treated like a PDF by Illustrator.

If you edit the PDF Compatible AI file in Acrobat and re-import this into Illustrator, you’ll quickly see Illustrator detect that the file has been edited outside of Illustrator and offer the ability to discard the changes or to keep the changes and reduce the editability of the AI file. Illustrator parses both the PDF representation and its private data and detects that they are different; from this it offers two possibilities. Either, the Illustrator file can be treated like an Illustrator file and the private data in the file (the Illustrator data) can be used, or the PDF data can be used and the capabilities of Illustrator that are not representable directly in an editable PDF format are then not available and the file is treated as if a PDF file. For example, the Swatches for the file are discarded when keeping the PDF representation of the file.

In summary: when you save an Adobe Illustrator file in PDF compatible mode, the resulting AI file can be used in read-only PDF workflows such as PDF viewers and text extraction tools. However, altering the PDF data does not alter the private application data that Illustrator keeps in the PDF and that represents the actual Illustrator file data. Altering the PDF file outside of Illustrator leads to a difficult decision when bringing the file back to Illustrator: either discarding the changes and using the Illustrator file data, or keeping the changes and losing the Illustrator-specific file features.
 


Need to edit PDFs? Adobe PDF Library gives you a comprehensive suite of capabilities. Download a free trial today.