"Export to PDF" issue

Discuss the drawing application
Post Reply
asoftz1
Posts: 5
Joined: Tue Feb 18, 2020 9:01 pm

"Export to PDF" issue

Post by asoftz1 »

When "exporting to pdf" reduced in size text that has been "converted to curves"
there is a serious deformation of the initial form. Normal font text of similar size
does NOT exhibit the same problem. This is easily visible from the Adobe pdf viewer
and others. With some effort it can be seen on a high quality print.
OpenOffice 4.01 for Windows XP
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: "Export to PDF" issue

Post by RusselB »

Welcome to the Forums
Please double check the actual font(s) being used vs. the requested font for that same portion of text in both the original and the PDF.
Most (if not all) operating systems will do a silent substitution of a font that is similar to a requested font if the requested font isn't available.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

Russel

That is an interesting thought.

AOO embeds the font in the PDF.

But imagine a document calls for a font Fred and Fred is not installed. AOO will display the document using a substitute font - say Arial.

But what happens in the PDF? Does AOO attempt to embed Fred and fail? Or does AOO embed the substitute font?
 Edit: I did a test with LO which I now use.

I created sigma.odt which uses the Sigma One font I have installed. I created a PDF and Properties showed the Sigma One font was embedded in the PDF.

I then uninstalled the Sigma One font.

When I opened the .odt file LO displayed the font name in italics telling me it was not installed (lovely! AOO does not tell the user) and used a substitute font. I could not see how to find out which substitute was being used. I then created a PDF and DejaVuSans was embedded.

So LO embeds the substituted font which means that a .odt file and a PDF created from it should always look identical even if a font is not available.
sigma.odt
.odt calling for Sigma One font
(9.34 KiB) Downloaded 257 times
sigma.pdf
PDF with Sigma One font embedded
(8.68 KiB) Downloaded 221 times
sigma not installed.pdf
PDF when Sigma One font has been uninstalled - DejaVuSans is embedded
(9.73 KiB) Downloaded 223 times
 
Last edited by John_Ha on Thu Feb 20, 2020 4:41 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

asoftz1 wrote:When "exporting to pdf" reduced in size text that has been "converted to curves" there is a serious deformation of the initial form.
I am sorry but I do not understand what you mean by "... text that has been "converted to curves" ...". Is this Fontwork? or normal text?
 Edit: Apologies - I see it is related to Draw not Writer.

Hoverer please upload the files as requested. 
Please upload a small .odg file and the PDF file created from it showing the problem so that it can be analysed.

Use the Upload attachment tab below where you type (128 kB max); or use a file share site, Dropbox or Google Drive for a larger file.
Last edited by John_Ha on Thu Feb 20, 2020 5:32 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: "Export to PDF" issue

Post by RoryOF »

I think a "font converted to curves" has effectively been traced to an outline, perhaps filled if the curves are closed. It should not therefore now depend on the presence on computer of the actual font. My memory (15 years ago?) is that "converted to curves gave a cutting line to cut out the font letters.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

Rory

Until we see the files we are unable to suggest anything. I had not spotted it was Draw not Writer :oops:
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: "Export to PDF" issue

Post by RoryOF »

I assumed from the "font converted to curves" that it must be Draw; I used this years ago in CorelDraw, for generating cut lines for lettering.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
asoftz1
Posts: 5
Joined: Tue Feb 18, 2020 9:01 pm

Re: "Export to PDF" issue

Post by asoftz1 »

Thanks for your response.

1) Is there a way to make an official bug report, to the Dev Team?

2) The problem is better defined here: https://www.sechee.net/TBgwtpjzXvociSCWum.zip
(Only for 10 days, starting from today, 21 Feb 2020)


Best regards
OpenOffice 4.01 for Windows XP
musikai
Volunteer
Posts: 294
Joined: Wed Nov 11, 2015 12:19 am

Re: "Export to PDF" issue

Post by musikai »

Hi
1. you can file Bugs here:
https://bz.apache.org/ooo/

2. Yes, the problem is an internal rounding problem for any vector content when exporting to PDF.
This was improved in LibreOffice 6.2.1 and higher.
See attachment, PDF export from LO6252 of your PDF which is much better.


Here is the LibreOffice Bug Report:
https://bugs.documentfoundation.org/sho ... i?id=96892

!!! Don't show that to the OpenOffice bug Devs. They aren't allowed to use LibreOffice Code and I can assure you, they will never do anything when they have access to this LO fix. I already had this problem as you can read in this case:
https://bugs.documentfoundation.org/sho ... ?id=113615
Attachments
LO6252_export_to_pdf_issue_0b.pdf
(49.39 KiB) Downloaded 202 times
Last edited by musikai on Sat Feb 22, 2020 4:23 pm, edited 1 time in total.
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

You say
The top formula has been converted to curves so that it can be reduced to any size easily.
I don't think you understand how scalable fonts work.

TrueType font character glyphs are specified by parametrised formulae. They are extremely carefully designed with arcs, curves and lines to define the contours and the character can therefore be drawn at any size whatsoever, from microscopic to mountainous. See the diagram below for how " b " is defined in a font.
Click if necessary to expand
Click if necessary to expand
You have decided to replace this extremely carefully designed set of accurate mathematical formulae defining the glyph with an approximation by fitting curves. The approximate curves will never be identical to the accuratly specified formulae used by the font so you are bound to see differences, especially when you multiply things 32x.

This is your "curves" in the PDF viewed at 6400%. Note how the bracket is very good as the smooth continuous curve is easily represented by a spline. Note how the straight lined x is terrible and the other characters, with tighter curves, are lumpy.
Click if necessary to expand
Click if necessary to expand
This is Arial 6pt Regular text in the PDF viewed at 6400%. Note how it is perfect.
Click if necessary to expand
Click if necessary to expand
If you want perfect characters then stop converting them to curves.

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

It seems that the smallest font AOO and LO will accept (without hacking content.xml) is 1 point obtained by typing 1 in the box. As you can see it is perfect when viewed in the PDF at 6,400%.
Click to expand if necessary
Click to expand if necessary
musikai's "curves created by LO" are considerably better but still worse, due to being approximations, that the actual font.
Click to expand if necessary
Click to expand if necessary
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
musikai
Volunteer
Posts: 294
Joined: Wed Nov 11, 2015 12:19 am

Re: "Export to PDF" issue

Post by musikai »

With all respect. This is not a user fault. This is a bug in OpenOffice and LibreOffice.
The LibreOffice fix make things better but I wish they would have solved the problem at its roots and removed the rounding bug completely and not just made it just more precise. Other vector programs like Inkscape don't have these problems and are to be preferred for any precision work.
Attachments
Tiny curve text Inkscape.pdf
(17.4 KiB) Downloaded 235 times
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

musikai wrote:With all respect. This is not a user fault. This is a bug in OpenOffice and LibreOffice.
I agree that there is a bug in AOO (worse) and in LO.
musikai wrote:Other vector programs like Inkscape don't have these problems and are to be preferred for any precision work.
You PDF is very good. I assume the characters are curves but they are excellent and I cannot fault even at the maximum magnification I can use. It would be interesting to see TNF font as it has more complex curves than the DejaVuSans you used so the approximation may well be more coarse.

But, with equal respect, the user is advised not to convert text to curves because

a) he can achieve everything he wants to do with the font itself as it is fully scaleable, and
b) no matter how good AOO and LO are the "approximate curves" will always be worse than the "exact formula representation used by the font",
c) AOO and LO are word processors to produce human readable text. If you want to produce text which is only a few microns high or a few miles high, don't use a word processor to do it as the Inkscape file shows.

The user error is in not understanding that TTF fonts are fully scalable so his requirement
The top formula has been converted to curves so that it can be reduced to any size easily.
is absolutely wrong as they can be reduced to 1pt at full accuracy - even if you need a magnifying glass to read them.

Now, if the font he was using was pixel based, instead of being fully scalable vector based, his requirement would be absolutely correct.
Last edited by John_Ha on Fri Feb 21, 2020 9:43 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

Well off topic ...

... but I did some hacking for fun :super:

I created test.odt with just one character set at 12 point. I hacked styles.xml to convert the paragraph style from 12pt to 0.1pt.

I then added another character at 6 pt and one at 1 point getting the results below. The PDF was the same.

Based on the 6pt being 279 pixels high, the 1 pt should be about 47 pixels high but it is 95 pixels suggesting it is actually 2pt and LO did not accept the typed 1.

Strangely LO produced the 0.1 character at 49 pixels, or 1 pt high.

Maybe LO uses integer values for pixel heights.

Even stranger was that, while editing, the " 0.1pt a " kept getting changed to a capital " A "!
PDF viewed at 6,400%
PDF viewed at 6,400%
Attachments
test.odt
(9.29 KiB) Downloaded 216 times
test.pdf
(12.61 KiB) Downloaded 201 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
asoftz1
Posts: 5
Joined: Tue Feb 18, 2020 9:01 pm

Re: "Export to PDF" issue

Post by asoftz1 »

I just wanted to add that:

A mathematical formula is created by a lot of independent text segments
grouped together at different positions.

If you try to reduce the size, of such a group, you get a mess. The only
way to do it, is by converting it, to curves.

The deformation produced even without a reduction, needs to be corrected
I believe. Producing some extra code to do this inside or outside OO (ie
a library) is something that I appreciate.


Best regards
OpenOffice 4.01 for Windows XP
asoftz1
Posts: 5
Joined: Tue Feb 18, 2020 9:01 pm

Re: "Export to PDF" issue

Post by asoftz1 »

Note that the issue arises when "converting to pdf". Internally OO Draw
"converted to curves" text and "scaled or not" appears to behave very well.
OpenOffice 4.01 for Windows XP
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

asoftz1 wrote: A mathematical formula is created by a lot of independent text segments grouped together at different positions.

If you try to reduce the size of such a group you get a mess. The only way to do it is by converting it to curves.
Please upload a small .odg file with a formula showing the problem so that it can be analysed. Use the Upload attachment tab below where you type (128 kB max); or use a file share site, Dropbox or Google Drive for a larger file.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
musikai
Volunteer
Posts: 294
Joined: Wed Nov 11, 2015 12:19 am

Re: "Export to PDF" issue

Post by musikai »

asoftz1 wrote:Note that the issue arises when "converting to pdf". Internally OO Draw
"converted to curves" text and "scaled or not" appears to behave very well.
Indeed, quality can be much better when printing to a PDF-printer with high dpi settings.
see attachment

What also gives good results is exporting to SVG.
I exported your odg to SVG, opened this SVG in Inkscape and exported then to PDF.
see attachment.
John_Ha wrote:It would be interesting to see TNF font as it has more complex curves
see atttachment.
Attachments
Print_to_FreePDF_graphics4000dpi_raster600dpi_issue_0b.pdf
(119.4 KiB) Downloaded 214 times
export_svg_then_Inkscape_export_to_pdf_issue_0b.pdf
(30.73 KiB) Downloaded 216 times
TinyTimesNewRoman.pdf
(26.65 KiB) Downloaded 233 times
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

The TNR text is lovely!
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: "Export to PDF" issue

Post by John_Ha »

asoftz1 wrote: A mathematical formula is created by a lot of independent text segments grouped together at different positions.
I see the problem - each character or few characters (eg cos) is a "unit" and each "unit" has to be selected and changed - you cannot do them all together. Can you group them?

I wonder why you are using draw for this?

Have you looked at the Math Formula in AOO? See the Math Guide. It allows formulae as small as 4 point and an entire formula can be changed in size in one go - see attached .odt file.
4 point Math formula.png
LaTeX, now called LEd, is widely regarded as the gold standard for maths formulae and scientific writing.

As an aside - why do you want such small text? Is it attached to a small sample and both are viewed through a microscope?
Attachments
formulae.odt
(14.68 KiB) Downloaded 195 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
asoftz1
Posts: 5
Joined: Tue Feb 18, 2020 9:01 pm

Re: "Export to PDF" issue

Post by asoftz1 »

In my effort to hint about something I have perhaps written something that
does not make much sense. ("appreciate") What i tried to say is that there
might be reasons for which the developers may not wish to do a better job
which cannot be discussed here.

As far as the pdf format, well today, it is the golden standard. Whether
to write a thesis, a scientific document, music, an advert or print something
at your local printers shop.

I have to sign off on this topic.
OpenOffice 4.01 for Windows XP
Post Reply