Bug 50879 - form exported as pdf does not embed all required fonts
Summary: form exported as pdf does not embed all required fonts
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
4.0.2.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pdf
: 104114 (view as bug list)
Depends on:
Blocks: Fonts PDF-Export
  Show dependency treegraph
 
Reported: 2012-06-08 06:05 UTC by schlittchen
Modified: 2019-09-04 18:16 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments
Document using LiberationSerif and LiberationSans (10.81 KB, application/vnd.oasis.opendocument.text)
2013-12-24 02:21 UTC, Robinson Tryon (qubit)
Details
PDF export of test ODT (16.23 KB, application/pdf)
2013-12-24 02:21 UTC, Robinson Tryon (qubit)
Details
test document (8.36 KB, application/vnd.oasis.opendocument.text)
2014-01-06 10:52 UTC, schlittchen
Details
pdf exported from test.odt (8.58 KB, application/x-pdf)
2014-01-06 10:52 UTC, schlittchen
Details
Screenshot of the example file in Acrobat Reader, Chrome and Edge (81.34 KB, image/png)
2019-05-22 12:31 UTC, Gabor Kelemen
Details
Working example from 2009 (109.56 KB, application/pdf)
2019-08-07 10:30 UTC, Gellért Gyuris
Details
Working example from 2009 (34.22 KB, application/vnd.oasis.opendocument.text)
2019-08-07 10:30 UTC, Gellért Gyuris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description schlittchen 2012-06-08 06:05:34 UTC
Form exported to pdf use a font 'LiberationSans' (Linux) or 'SegoeUI' (Windows) but do not embed this font. This makes the exported pdf unusable any platform that does not provide the font in question - form created under Linux are unsable under Windows and vice versa.

A very simple example form created under Linux without any bells and whistles:

~$ pdffonts testformular.pdf 
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
BAAAAA+LiberationSerif               TrueType          yes yes yes     14  0
LiberationSans                       TrueType          no  no  no      16  0
Comment 1 schlittchen 2013-06-04 08:04:02 UTC
The problem is still there in 4.0.2.2. It is easy to reproduce:

Create a form on Linux, export as PDF, open it using (for example)
Acrobat Reader on Windows. You get a message about missing fonts (LiberationSans
in my case). The static text shows ok, but the form fields only show placeholder chars when filled. Choosing to embed standard fonts while exporting does not
help.

This makes the creation of cross-platform PDF-forms effectivly impossible.
Comment 2 Oho 2013-07-14 07:21:02 UTC
You might save the file as PDF/A-1a.

From LibreOffice Help, by following this choice, the program "Converts [the file] to the PDF/A-1a format. This is defined as an electronic document file format for long term preservation. All fonts that were used in the source document will be embedded into the generated PDF file. PDF tags will be written."

So, all fonts, not only the standard fonts, "will be embedded into the generated PDF file". Maybe you dont want the tags, but you get them, as well.

Of course, the "Export as PDF ..."/"General" dialogue could reveal more about the meaning of the "PDF/A-1a" choice.
Comment 3 Oho 2013-07-14 07:44:26 UTC
The "standard fonts" from the "Embed standard fonts" choice, are "the 14 standard Postscript fonts", according to LibreOffice Help.

The choice "Embed standard fonts" would lead to the embedding of all your document fonts if and only if you are using only [some of] these fonts as fonts in your documents.
Comment 4 Oho 2013-07-14 08:05:42 UTC
The "Export as PDF ..."/"General" dialogue should be less cryptic about the meaning of these two choices:

Perhaps:

- the "embed standard fonts" shoud be replaced by "embed the 14 standard Postscript fonts".

- the "PDF/A-1a" should be replaced by "embed all used fonts and all tags".

Also, the "Embed standard fonts" subtitle under the title "General tab" entry in the help, could be augmented by defining the 14 Postscript standard fonts, something like:

"Specific common Type 1 fonts installed as a part of the Adobe Acrobat installation:

- 4 versions [regular, bold, italic or oblique, and bold italic] of Times (v3) or Times New Roman PS MT (v4.x)
- 4 versions [regular, bold, italic or oblique, and bold italic] of Helvetica (v3) or Arial MT (v4.x)
- 4 versions [regular, bold, italic or oblique, and bold italic] of Courier - 4 versions
- Symbol
- Zapf Dingbats"
Comment 5 Robinson Tryon (qubit) 2013-12-24 02:21:14 UTC Comment hidden (obsolete)
Comment 6 Robinson Tryon (qubit) 2013-12-24 02:21:55 UTC Comment hidden (obsolete)
Comment 7 Robinson Tryon (qubit) 2013-12-24 02:34:14 UTC Comment hidden (obsolete)
Comment 8 schlittchen 2014-01-06 10:52:18 UTC
Created attachment 91537 [details]
test document
Comment 9 schlittchen 2014-01-06 10:52:44 UTC
Created attachment 91538 [details]
pdf exported from test.odt
Comment 10 schlittchen 2014-01-06 10:55:30 UTC
The document you attached is not a form, just a text.

The problem is that the font used for input fields (default is Liberation Sans) needs to be embedded completely, but isn't. My guess is that the algorithm that decides which fonts to embed does not account for form input fields correctly.

I attached a test form odt and the exported pdf:

$ pdffonts test.pdf
name                                 type              encoding         emb sub uni object ID                               
------------------------------------ ----------------- ---------------- --- --- --- ---------                               
BAAAAA+LiberationSerif               TrueType          WinAnsi          yes yes yes     13  0                               
LiberationSans                       TrueType          WinAnsi          no  no  no      15  0
Comment 11 Owen Genat (retired) 2014-09-14 14:42:22 UTC
(In reply to comment #10)
> The problem is that the font used for input fields (default is Liberation
> Sans) needs to be embedded completely, but isn't. My guess is that the
> algorithm that decides which fonts to embed does not account for form input
> fields correctly.

Reproduced under GNU/Linux using v4.3.1.2 Build ID: 958349dc3b25111dbca392fbc281a05559ef6848 using the provided example.
Comment 12 jelhan 2014-10-22 13:19:31 UTC
Bug is still there under LibreOffice Writer 4.2.63 running on Linux Ubuntu 14.04 LTS and Windows 8.1. Only a font subset is embeded even when font is used in a formular. So if user trying to fillout the formular has not installed font he is unable to proceed.
Comment 13 Joel Madero 2014-11-05 03:19:52 UTC Comment hidden (obsolete)
Comment 14 Robinson Tryon (qubit) 2014-11-12 01:29:02 UTC
(In reply to schlittchen from comment #10)
> The problem is that the font used for input fields (default is Liberation
> Sans) needs to be embedded completely, but isn't. My guess is that the
> algorithm that decides which fonts to embed does not account for form input
> fields correctly.
> 

CONFIRMED with LO 4.4.0.0.alpha2 + Ubuntu 14.04

Tested with attachment 91537 [details].
Exported using the PDF button (stock export behavior)

$ pdffonts
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
BAAAAA+LiberationSerif               TrueType          WinAnsi          yes yes yes     11  0
LiberationSans                       TrueType          WinAnsi          no  no  no      13  0

And indeed, LiberationSans was not embedded into the document.
Comment 15 mstrey 2015-01-15 14:16:10 UTC
Any news about this bug? 
It still not embed font used in fields.
Comment 16 Robinson Tryon (qubit) 2015-01-15 16:09:57 UTC
(In reply to schlittchen from comment #1)
> Create a form on Linux, export as PDF, open it using (for example)
> Acrobat Reader on Windows. You get a message about missing fonts
> (LiberationSans
> in my case). The static text shows ok, but the form fields only show
> placeholder chars when filled.

when you say "placeholder chars", what does that entail? Do you mean the same glyphs but in a different font, just rectangles, or?

> 
> This makes the creation of cross-platform PDF-forms effectivly impossible.

Yep, it's important for me to understand the impact of this bug so we can properly triage it. Thanks!
Comment 17 Paolo Melchiorre 2015-02-12 18:39:07 UTC
Confirm bug on Ubuntu GNU/Linux 14.10

Libreoffice
Versione: 4.4.0.3
Build ID: 40m0(Build:3)
Versione locale: it_IT
Comment 18 Ingo Belka 2015-02-17 09:34:03 UTC Comment hidden (obsolete)
Comment 19 Ingo Belka 2015-09-23 05:58:46 UTC
Take a Look on this https://bugs.documentfoundation.org/show_bug.cgi?id=82509#c13
Comment 20 schlittchen 2015-10-23 11:36:44 UTC
This bug is still there in 5.0.2.2.
Comment 21 Joel Madero 2015-10-23 14:31:30 UTC
Please slow down and read the warnings carefully...when you change the version it very explicitly says version field is the oldest version tested on not the latest. Reverting change.
Comment 22 Peter Nagy 2016-04-07 16:31:06 UTC
This bug is still there in 5.0.5 and 5.1.1.3
Comment 23 Alex Thurgood 2016-11-24 10:09:46 UTC
*** Bug 104114 has been marked as a duplicate of this bug. ***
Comment 24 Joe 2017-07-05 21:08:26 UTC
I am having this same problem on 5.1.6.2 using Ubuntu 16.04.  I create a form in Libre Office, export it to PDF, and when I open it in Windows in Acrobat Reader I receive the message about missing fonts and all of the drop down menus that I created in the form only show dots where they should show words.
Comment 25 Moritz 2017-07-23 13:43:11 UTC
I'm having the same problem on LibreOffice 5.4.0.1 on openSUSE.
Comment 26 Liam Morland 2017-09-14 23:25:03 UTC
I am observing this problem as well in version 5.4.0.3 on Debian.

I would be happy if there was a way to set the form control's font to one of the standard 14 PostScript fonts so that there is no need to embed anything. I just need the form controls to be readable.
Comment 27 Marc R 2017-10-09 18:37:08 UTC
Is this bug being worked on? Having the same issue (create a form in Libre Office, export it to PDF, and when I open it in Acrobat Reader receive the message about missing fonts). Would be great to get a fix!

OSX, LibreOffice 5.4.2.2
Comment 28 kevin.quiggle 2018-03-23 17:29:43 UTC
This bug is still present in Version: 6.0.2.1 (running on Ubuntu Linux 16.04).  As a workaround, I installed the Arial font on my Linux system and used this font for the form fields.

Some additional experiments using Liberation Serif font showed that even when the font is present as an embedded subset it fails to display properly in form fields, even though it properly displays in the rest of the document.
Comment 29 airbuff 2018-05-12 10:13:17 UTC
macOS 10.13.4
Libreoffice 5.2.7.2

The issue shows up here too.

Repro:
- Create writer document
- Add form elements (I use text fields and checkboxes)
- Make sure the form elements use a non standard font that would have to be embedded when exporting as PDF
- Make sure File/Properties/Font embed fonts is checked
- save
- file/export as pdf
- under "General" options, make sure "Create PDF Form" is ticked
- Export

- Open PDF in Acrobat Reader
- Open File/Properties
- check "Font" tab
- find the used font

Expected:
Font is found as we embedded it.

Actual:
"Actual Font: Unknown"

the issue doe *not* show up choosing the "Archive PDF/A-1a..." option in export PDF dialogue. Unfortunately this option does not allow to "Create PDF Form", which is mandatory for us.
Comment 30 QA Administrators 2019-05-13 02:50:14 UTC Comment hidden (obsolete)
Comment 31 Liam Morland 2019-05-19 17:46:54 UTC
The problem still exists on LibreOffice 6.1.5.2 on Debian.
Comment 32 Gabor Kelemen 2019-05-22 12:31:07 UTC
Created attachment 151592 [details]
Screenshot of the example file in Acrobat Reader, Chrome and Edge

Still occurs, I get a warning from Acrobat Reader that the LiberationSans font is missing and some characters won't show up appropriately.
Indeed the form field shows lots of characters as dots.

This is on a machine without any LibreOffice installed. Reinstallation (which includes the missing font) solves this problem.

Interestingly, web browsers can replace missing fonts rather reliably.
Comment 33 Gellért Gyuris 2019-08-07 10:30:20 UTC
Created attachment 153197 [details]
Working example from 2009

This is a regression. 

I have a good exported document from 2009. I made this document with OpenOffice 3.0. See attachments. There are no problem with Adobe Reader, Master PDD Editor, Foxit Reader, Chromium, Evince. Works as expected.

pdffonts "PDF form with OpenOffice 3.0.pdf" 
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
BAAAAA+CharisSIL-Bold                TrueType          WinAnsi          yes yes yes    105  0
CAAAAA+Gentium                       TrueType          WinAnsi          yes yes yes     95  0
DAAAAA+Gentium-Italic                TrueType          WinAnsi          yes yes yes    100  0
Helvetica                            Type 1            WinAnsi          no  no  no       5  0
ZapfDingbats                         Type 1            ZapfDingbats     no  no  no      11  0
Comment 34 Gellért Gyuris 2019-08-07 10:30:53 UTC
Created attachment 153198 [details]
Working example from 2009
Comment 35 Gellért Gyuris 2019-08-08 17:11:45 UTC
Workaround... add this script to exported PDF as a top-level document JavaScript:

function updateFields() {
  for ( var fieldNumber = 0; fieldNumber < this.numFields; fieldNumber++) {
    getField(getNthFieldName(fieldNumber)).textFont = font.Helv;
  }
}
updateFields();

Other fonts:
Times-Roman           = font.Times
Times-Bold            = font.TimesB
Times-Italic          = font.TimesI
Times-BoldItalic      = font.TimesBI
Helvetica             = font.Helv
Helvetica-Bold        = font.HelvB
Helvetica-Oblique     = font.HelvI
Helvetica-BoldOblique = font.HelvBI
Courier               = font.Cour
Courier-Bold          = font.CourB
Courier-Oblique       = font.CourI
Courier-BoldOblique   = font.CourBI
Symbol                = font.Symbol
ZapfDingbats          = font.ZapfD
Comment 36 p10 2019-08-28 19:11:01 UTC
(In reply to Gellért Gyuris from comment #35)
> Workaround... add this script to exported PDF as a top-level document
> JavaScript:
> 
> function updateFields() {
>   for ( var fieldNumber = 0; fieldNumber < this.numFields; fieldNumber++) {
>     getField(getNthFieldName(fieldNumber)).textFont = font.Helv;
>   }
> }

Hello,

Where do I put this code ? in LO ? in a new module ?

Thanks.
Comment 37 Gellért Gyuris 2019-09-04 16:34:08 UTC
(In reply to p10 from comment #36)
> 
> Hello,
> 
> Where do I put this code ? in LO ? in a new module ?
> 
> Thanks.

Not in LO. Export document in LO to PDF, and add this small script with a PDF-editor. I used Master PDF Editor (Document>Document Javascript).