Scribus Forums

Scribus => PDF Generation => Topic started by: micro on March 30, 2021, 04:29:31 am

Title: Bloated interactive PDFs
Post by: micro 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:


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:


Thanks for reading!
Title: Re: Bloated interactive PDFs
Post by: toyotadesigner 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
Title: Re: Bloated interactive PDFs
Post by: Nermander 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.

Title: Re: Bloated interactive PDFs
Post by: micro 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:


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.
Title: Re: Bloated interactive PDFs
Post by: Nermander 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?
Title: Re: Bloated interactive PDFs
Post by: micro on June 03, 2021, 05:12:54 am
I tried Libre Office a while back for interactive forms and it was not up to my layout requirements.

I will persist with Scribus as I think it's an amazing layout tool and it does 95% of what I need it to for interactive PDFs. Obviously some developers on the team think it's for more than just print.

For now, post-processing in Acrobat Pro gets my files down to a reasonable size. I also use it to Extend Features in Adobe Reader which further improves the end user experience (e.g. closing an unchanged PDF form does not ask the user to save). So while I still have a small dependency on Adobe products, at least it can be purchased as an outright license rather than paying their outrageous subscription fees.