Scribusoid

Author Topic: Bloated interactive PDFs  (Read 505 times)

micro

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Bloated interactive PDFs
« on: March 30, 2021, 04:29:31 am »
My quest is to replace Adobe Suite with FOSS, and interactive PDFs are critical to our business - we have designed dozens of them for various purposes.

I'm using the dev version Scribus 1.5.6.1.

There is one specific issue I'd like to raise which is bloat in interactive PDFs. I did some testing to show the issue. I created a single line text box on a blank A4 page in both Scribus and Acrobat 9 Pro. Consider the results:

  • Scribus-exported PDF: 696 KB
  • Acrobat 9 Pro PDF: 13 KB

That's >53x!

If the Scribus PDF is then run through Acrobat 9 Pro, Document -> Reduce File Size.... then it drops from 696 KB down to 37 KB. What a savings! This is not graphics compression; there are no graphics on the page. It seems to be unnecessary overheads stored in the PDF.

This is a real-world problem. For example a 4-page form we use regularly is 461 KB using InDesign+LCD, 1798 KB using Scribus, and 1017 KB after reducing in Acro9Pro.

Scribus export compression & compatibility settings make very little difference to our exported PDF file sizes (YMMV).

I guess the purpose of this post is 2-fold:

  • To raise community awareness of the issue and generate discussion.
  • To ask the community whether there are any known FOSS solutions that reduce file size similar to that function in Acro9Pro? So far I haven't found any.

Thanks for reading!

toyotadesigner

  • Jr. Member
  • **
  • Posts: 95
  • Karma: 0
  • Active Scribus Mac User
    • architectural, industrial and business photography
Re: Bloated interactive PDFs
« Reply #1 on: April 05, 2021, 09:43:06 am »
It all depends on your export settings / PDF generation. I've conducted a test as follows: Single page A4, text frame with 3 columns, gap 4 mm, font type Raleway v 4020 @10 pt, all columns filled with text.

PDF # 1: Export as PDF/X-4, including crop marks, bleed marks, etc. for professional printing, resulting size: 2 MB
PDF # 2: Export as PDF 1.3, resulting size: 39 KB

So maybe you should check your PDF export parameters.

Attached screenshot show the PDF # 2 settings

Nermander

  • Hero Member
  • *****
  • Posts: 1432
  • Karma: 19
Re: Bloated interactive PDFs
« Reply #2 on: April 05, 2021, 11:10:06 am »
As far as I know there are a few things affecting the file size to a large extent:

1. Embedding fonts. Complete fonts are big.

This page containts some good explanations.
https://www.evermap.com/PDFFileSize.asp

Also rememeber that Scribus will embed all fonts that are defined in a style in the document, even if there is no text in the final PDF using that font. So if you have defined many styles, with different fonts, but do not use them. They will still contribute to the file size.

A very common issue is that the default font for text frames is embedded, even though it is not used by any text.


2. Scribus' goal is good print quality, which means it places text with high precision. While another application may "place the cursor and then output a full line of text", Scribus more or less places the cursor for each word or even each glyph (to make sure the glyphs end up exactly where they are supposed to). This means that the commands to move the cursor will take up a a lot of space, sometimes even more space than the actual text.


While large images are often a problem with PDFs created with other programs, for Scribus created documents the images are often not the cause of large file size.


micro

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Re: Bloated interactive PDFs
« Reply #3 on: April 08, 2021, 07:29:15 am »

1. Embedding fonts. Complete fonts are big.

...

Also rememeber that Scribus will embed all fonts that are defined in a style in the document, even if there is no text in the final PDF using that font. So if you have defined many styles, with different fonts, but do not use them. They will still contribute to the file size.

A very common issue is that the default font for text frames is embedded, even though it is not used by any text.

Hi Nermander

Your reply was very helpful for me, so many thanks.

All I'm doing here is putting a text field on a blank page, so there are effectively no glyphs to position (well, ok, probs 1 glyph for the text box).

Your comments on font, however, are on the money. I did some further testing and got some surprising results:

  • I use a single font, Times New Roman, in all styles.
  • My default text is set to the same in Document Setup -> Item Tools, and also in Preferences -> Item Tools. When I create a new text frame it uses this default.
  • If I export PDF setting Embedding Mode to 'Embed or Subset' then I get the entire TNR font embedded and file size is 689 KB. TNR is the only font showing in the export dialog. I cannot choose to subset it - which makes sense since as a user input they could type anything in the font. What's weird is that the exported PDF also has subsets of Helvetica and ZapfDingbats and I have no idea why.
  • Actually there are two TNR fonts embedded in the above. The first says 'Type: TrueType' and the second 'Type: TrueType (CID)'.
  • If I change Embedding Mode to 'Do Not Embed' the file size drops to 59KB. The form still seems to work fine. The same fonts are in the document but TNR does not say embedded so I guess that means subset only. Weird once again as there is no text on this page.
  • The Acro9Pro generated version, and the one processed with Reduce File Size, show no fonts at all in the document, neither embedded nor subsetted. I guess that's why the file size is so small.

Anyway, still some mysteries here but my understanding has improved at least slightly. I remain confused about how important font embedding is in this context.

Nermander

  • Hero Member
  • *****
  • Posts: 1432
  • Karma: 19
Re: Bloated interactive PDFs
« Reply #4 on: April 08, 2021, 09:58:04 pm »
Well, if you are just going to use it for forms, maybe Scribus is not the best tool, because as I said: Scribus' goal is good print quality

From what I understand also Libre Office Writer can be used to create PDF forms, maybe it gives smaller PDFs?

 

palmate