Bug 154099 - Printing to file produces a PDF of lesser quality than converting to PDF
Summary: Printing to file produces a PDF of lesser quality than converting to PDF
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Print
  Show dependency treegraph
 
Reported: 2023-03-09 17:17 UTC by Vincent Lefevre
Modified: 2023-05-18 20:35 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
the text file file.txt (1.44 KB, text/plain)
2023-03-09 17:19 UTC, Vincent Lefevre
Details
the PDF file obtained with "--convert-to pdf" (20.39 KB, application/pdf)
2023-03-09 17:19 UTC, Vincent Lefevre
Details
the PDF file obtained with "--print-to-file" (20.54 KB, application/pdf)
2023-03-09 17:20 UTC, Vincent Lefevre
Details
screenshot of 7.6.0.0.alpha1+ test results: export to pdf (top), print to file (bottom) (113.07 KB, image/png)
2023-05-17 22:25 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lefevre 2023-03-09 17:17:49 UTC
Consider the following text file, which comes from
  https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt

cventin:~> cat file.txt
Box drawing alignment tests:                                          █
                                                                      ▉
  ╔══╦══╗  ┌──┬──┐  ╭──┬──╮  ╭──┬──╮  ┏━━┳━━┓  ┎┒┏┑   ╷  ╻ ┏┯┓ ┌┰┐    ▊ ╱╲╱╲╳╳╳
  ║┌─╨─┐║  │╔═╧═╗│  │╒═╪═╕│  │╓─╁─╖│  ┃┌─╂─┐┃  ┗╃╄┙  ╶┼╴╺╋╸┠┼┨ ┝╋┥    ▋ ╲╱╲╱╳╳╳
  ║│╲ ╱│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╿ │┃  ┍╅╆┓   ╵  ╹ ┗┷┛ └┸┘    ▌ ╱╲╱╲╳╳╳
  ╠╡ ╳ ╞╣  ├╢   ╟┤  ├┼─┼─┼┤  ├╫─╂─╫┤  ┣┿╾┼╼┿┫  ┕┛┖┚     ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
  ║│╱ ╲│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╽ │┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▎
  ║└─╥─┘║  │╚═╤═╝│  │╘═╪═╛│  │╙─╀─╜│  ┃└─╂─┘┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▏
  ╚══╩══╝  └──┴──┘  ╰──┴──╯  ╰──┴──╯  ┗━━┻━━┛  ▗▄▖▛▀▜   └╌╌┘ ╎ ┗╍╍┛ ┋  ▁▂▃▄▅▆▇█
                                               ▝▀▘▙▄▟

If I convert this file to PDF with writer_pdf_Export by using

cventin:~> libreoffice --headless --convert-to pdf file.txt
convert /home/vlefevre/file.txt -> /home/vlefevre/file.pdf using filter : writer_pdf_Export

then I get a PDF with some spacing issues. But if I convert it to PDF via printing to file

cventin:~> libreoffice --headless --print-to-file file.txt
print /home/vlefevre/file.txt -> /home/vlefevre/file.pdf using <default_printer>

then the obtained has even more spacing issues.

I'm going to attach all these files.
Comment 1 Vincent Lefevre 2023-03-09 17:19:00 UTC
Created attachment 185868 [details]
the text file file.txt
Comment 2 Vincent Lefevre 2023-03-09 17:19:49 UTC
Created attachment 185869 [details]
the PDF file obtained with "--convert-to pdf"
Comment 3 Vincent Lefevre 2023-03-09 17:20:21 UTC
Created attachment 185870 [details]
the PDF file obtained with "--print-to-file"
Comment 4 Vincent Lefevre 2023-03-09 17:22:04 UTC
Note: the machine is a Debian/unstable with the libreoffice 4:7.4.5-2 Debian package.
Comment 5 Stéphane Guillou (stragu) 2023-05-17 22:23:48 UTC
Thanks for the report, Vincent.

I could already see the very marked difference in:

Version: 6.0.0.3
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group

In a recent master build, I get overall better results, but still some difference between the two methods, using Ubuntu 20.04 with GNOME 3.36.8 and:

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 1349f140fcc49e5da78482ca3db09663ccdae0a9
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 6 Stéphane Guillou (stragu) 2023-05-17 22:25:22 UTC
Created attachment 187358 [details]
screenshot of 7.6.0.0.alpha1+ test results: export to pdf (top), print to file (bottom)