An .aifile already contains a PDF, so this conversion should be trivial — and mostly it is. The interesting part is what you get to change on the way through, and why the obvious shortcut is not quite as good as it looks.
The rename trick, and its three catches
Since Illustrator 9, saving a file writes a full PDF representation of the artwork alongside Illustrator's own data. That is why a genuine .ai file starts with the bytes %PDF-1.5, and why renaming it to .pdf often just works.
Three things that trick will not do for you:
- It carries Illustrator's private data along, so the file is larger than the artwork needs.
- You get every artboard exactly as saved. No removing the working versions before you send it.
- It fails silently on files saved without PDF compatibility — the reader simply refuses to open them.
This converter parses the artwork and writes a fresh PDF from it, which fixes the first two and gives you a clear message about the third.
Change it before you send it
Once the file parses, every object is separate and editable. Fix a phone number, update a price, swap a colour, or delete the three exploratory artboards nobody else needs to see. The PDF is written from what is on screen.
Text stays text
The type in your Illustrator file is read as text and written back as text, so the finished PDF is selectable, searchable, and copyable. Nothing is converted to outlines or flattened into a picture along the way.
Before a commercial print run
A clean vector PDF is the right starting point, but a press normally also wants bleed, crop marks, and CMYK. Check an existing file with the PDF preflight tool or confirm its dimensions with the PDF page size checker.
The same conversion in code
This page is built on the public SDK. Because .ai is a PDF container, the importer needs no special case:
import { pdfToJson } from "@polotno/pdf-import";
import { jsonToPDFBlob } from "@polotno/pdf-export/browser";
// An .ai file is a PDF container - pass the bytes straight in.
const buffer = await file.arrayBuffer();
const json = await pdfToJson({ pdf: buffer });
// A fresh vector PDF, one page per artboard, text still selectable.
const blob = await jsonToPDFBlob(json);Full API reference: PDF Import, PDF Export, and the Import & Export overview.
