Here is what I tried:

  • Save this maths formula from Wiki as SVG
  • Open the SVG in Adobe Illustrator
  • Save it as PDF (File / Save as / Format PDF)

enter image description here

I noticed that the file size of the PDF is 60x times larger (600KB bs. 10KB). While I can accept that PDF is a somewhat bloated, proprietary format, I still cannot believe this discrepancy.

Can anyone explain to me why SVG can save the vector graphics more size-efficiently, and how I can reduce the file size of the PDF (without sacrificing any quality).

I can imagine that it has something to do with the PDF presets. But I am reluctant to change those, because I often get problems after changing presets when importing PDFs in other tools (e.g., Microsoft Office tools).

  • 2
    I have used Inkscape and the PDF size is only 33kB.
    – s.ouchene
    Nov 20, 2022 at 18:28
  • 2
    When I use Inkscape to convert your input file, I only get a 22kB PDF as well. If I had to guess, there is probably a bitmap thumbnail embedded in your output, that inflates the file size. Make sure to disable any option that may add a preview image to your PDF.
    – Xrott
    Nov 20, 2022 at 18:31
  • 2
    You may also check whether the option to keep the file editable in Illustrator is set. If so, the Illustrator file is embedded in the PDF.
    – Max Wyss
    Nov 21, 2022 at 8:49

3 Answers 3

  1. When you do File Save as, choose PDF as the file format

  2. In the PDF export dialog, deselect the option that says Preserve Illustrator Editing Capabilities*

  3. Click Save PDF, and then click OK when the warning about disabled editing features appears

This will result in a PDF that is approximately 40kb. I tested this on your SVG, and it works just fine. It will not reduce the quality of the PDF in any way.

*Note: Deselecting this option simply discards the Illustrator document data which is what is responsible for making the file size so large. This extra Illustrator documnent data is not required for a normal PDF, only if you were going to edit the PDF later in Illustrator. Obviously you should make sure you save your original AI file if you want to edit it later.

  • Thanks. This worked well for me. Dropping the illustrator document still allows me to edit the PDF in Illustrator later. But this case here was probably too trivial to notice any difference.
    – normanius
    Nov 22, 2022 at 16:23

SVG is generally less compact than PDF but only marginally different if you accept zipped SVG files. So PDF is in fact more generally more space efficient than SVG. Although since many editors want to add the whole kitchen sink into the file, so it does not appear to be compact. Its just that in this particular case the problem lies in opening the file into an editor that refuses to reuse the font symbols as repeated instances and stores the file 3 times inside the file itself (illustrator compatibility and a bitmap preview).

There is technically no reason why PDF couldn't do the exact same thing in a smaller file. Its just that the pipeline your using does not support converting the symbols to instances. But on that note i can easily get a file in similar size range if i embed the font subset directly out of the TeX file.

  • Thanks for the technical insights. Which are the three files: the actual document, the illustrator compatibility document, and a bitmap preview?
    – normanius
    Nov 22, 2022 at 16:28
  • 1
    @normanius Yes. Theres also some random stuff such as fast webload, metadata, page oreviews and such too but mostly the three things+destruction of instancing bulk up the file
    – joojaa
    Nov 22, 2022 at 16:33
  1. Select all the path anchors you want to be in your export file
  2. Open Window > Asset Export
  3. Click the square with plus (generates an asset from the current selection)
  4. Select PDF in the drop down below
  5. Click "Export" and select path

Your file will be around 60-70 Kb for this case

Details: PDFs have a minimum size. We cannot go below this size because PDF carry a lot of data, even if not used. Your file increases by factor 6. For other situations it will be the reverse depending on the compression you choose. but for normal use you'd like to to take these steps more easily to use )

  • pdfs have no minimum size in range of tens of kilobytes. i mean its true theres a lookup table at the end but thats just hundreds of bytes.
    – joojaa
    Nov 23, 2022 at 5:00
  • In this case the PDF carry Illustrator editable capability
    – Cid-Wings
    Nov 24, 2022 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.