7

Following Safe size for printing image from browser, I saved my Illustrator file with vector drawings as a PDF. It weighs three times more than the PNG export of the same file at 300 ppi, 4.2 MB versus 1.5 MB. The Illustrator file, saved without the PDF compatible file, is 2.7 MB. Here is the design, saved at 72 ppi:

Design with drop shadows

On another design without a drop shadow, the PDF is 538 KB and the PNG is 228 KB.

Why is the PDF file much larger for purely vector art?

Update: Here are the main settings when saving as PDF (general and compression, and I can add the others if relevant):

General save settings

Compression save settings

2
  • 1
    Theres more stuff in a PDF file. You are including the font... Your using zip compressed images, you have thumbnails, more metadata same amount of pixels and vector data on top.
    – joojaa
    Jul 12, 2020 at 11:10
  • 1
    PNG images are NOT vectorized, PNG doesn't support it, when you export to PNG, you convert your vectors to just a bunch of pixels. PDF, on the other hand, actually supports vectorized images, in PDF you save the vector data, PNG doesn't.
    – hanshenrik
    Jul 13, 2020 at 16:54

4 Answers 4

15

Since you haven't shown your PDF export settings, I can only make some guesses.

If you have the "Preserve Illustrator editing capabilities" option checked when exporting the PDF, that could explain a larger than expected file size. Basically, that setting saves both the AI file data and the PDF data in the one file. Try disabling it. Obviously, make sure that you've saved your AI file first, since the PDF will no longer be properly editable in Illustrator.

Effects such as drop shadows will be rasterized when exporting to PDF. If your PDF settings are set up for high quality printing, this means you could have one or more large raster images contained within the PDF. PDFs can contain both raster and vector images.

Also there's no guarantee that a pure vector image will be close to a PNG's file size. Vector file sizes depend on how many paths, anchors and individual objects there are in the design (i.e. the amount of data), and the file size of a PNG will depend on how many pixels are in it, and the colour mode (i.e. indexed versus RGB, or RGBa). Vector and raster file sizes are not really comparable.

5
  • 1
    I updated the question with the PDF settings. I agree that vector and raster are not really comparable. In this case, since the design is mostly text and the vector shapes are simple, I found the discrepancy surprising. Jul 12, 2020 at 10:34
  • 4
    @miguelmorin Actually the vector shapes are not so simple. The design with have lots of paths and curves data, perhaps even excess anchors. Combine those issues with the rasterized drop shadow issue, and those alone may explain a larger than expected file size. There's nothing surprising here. Also a 5MB file is not a large file.
    – Billy Kerr
    Jul 12, 2020 at 10:38
  • 3
    Also fonts are embedded etc etc also the zip method for compression is way less efficient than other methods
    – joojaa
    Jul 12, 2020 at 11:05
  • 3
    @joojaa - absolutely. Ultimately though, I don't think the file size is actually that bad. A high quality print PDF at 5MB is not excessive. I've created PDFs in excess of 300MB for various print jobs, and even these are not a problem.
    – Billy Kerr
    Jul 12, 2020 at 11:43
  • 1
    @BillyKerr Being primarily a book-layouter, I have frequently uploaded PDFs exceeding 5 GB in size to printers. I agree very much that 5 MB for an A4 print job is perfectly acceptable – but since in this instance, it’s apparently meant to be printed out by home users who download the PDF, it may be a bit much if every individual page is 5 MB. Jul 14, 2020 at 12:47
4

In general

Let me spam you another answer: Svg file size more than a png image

Here is a graph where the x-axis is the pixel size and the y-axis is the file size.

A vector file is mostly independent of the dimensions and a raster image is proportional to it.

But that is not the full story.

Now let us think in an uncompressed raster image vs a vector file both with fixed dimensions. But now let's change the x-axis, now it is "information".

You can have one tiny or several circles defined in the image. On a bitmap the diference will be the color of the pixels but the pixel count is the same. The size of the file will not change.

But now put two circles on a vector file vs one. You have doubled your information. Let us think something like:

<circle cx="50" cy="50" r="50" stroke="black" stroke-width="5" fill="black" />

Now put 3, 4, N circles.

<circle cx="50" cy="50" r="50" stroke="black" stroke-width="5" fill="black" />
<circle cx="50" cy="50" r="50" stroke="black" stroke-width="5" fill="black" />
<circle cx="50" cy="50" r="50" stroke="black" stroke-width="5" fill="black" />
<circle cx="50" cy="50" r="50" stroke="black" stroke-width="5" fill="black" />

The increase in the information is linear. The information will increase for any new feature added to your file.


On your specific image

You have a shadow. This can be an actual bitmap for faster processing or could be the instructions on how to re-render it each time. This can make a difference in file size, but also in processing time. Imagine you need to repeat the instructions each time.

On your update, you mention linking an external photo to a file. On a PDF file, there are not linked files. They are inside the file. The file inside could be resampled, and compressed, or not depending on the settings. It can also have fonts converted as curves or the font file embedded or not.

On a native file you have the file actually linked, but with a preview embedded.


Conclusion

There are a lot of factors to consider thinking about a file "weight". Vector information, instructions, raster effects, raster images, preview, scripts, layers, embedded information, objects not displayed, etc. You can not think about file size just in terms of vector vs raster.

2

You can not actually know how big the file is going to be beforehand. It is perfectly possible that a PNG export is smaller than a PDF file this is especially likely if your file has big raster elements in it since the PDF will contain the full raster data + all layering of such raster data + all the other data while a PNG just contains one flat layer of pixels.

Now its impossible to know how big a PDF files vector data is going to be to do so i would need to see the vector construction and cogitate on it. But lets just say since you have a font on the page and about half of what is on the page is vectors its not entirely unreasonable that this would be half the file. If it would be tripple the size of the file or just half wouldn't supprise me to the slightest.

0

Following PDF only with JPG photo is 7 times larger than original one solution could be to use JPEG compression for raster images instead of the default ZIP compression, which is similar to PNG. At JPEG compression of maximum quality, the PDF file weighs 1.9 MB.

Your Answer

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

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