Bug 155983 - Strange black squares appear when loading PDFs with LibreOffice Draw
Summary: Strange black squares appear when loading PDFs with LibreOffice Draw
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2023-06-22 04:37 UTC by lij1478
Modified: 2023-07-17 23:30 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
One PDF that could not be loaded properly with LibreOffice Draw (12.74 KB, application/pdf)
2023-06-22 05:47 UTC, lij1478
Details
BUG 复现(BUG Reproduction) (1.03 MB, video/mp4)
2023-07-08 08:06 UTC, lij1478
Details
no issue with PDF with Insert filter and 600dpi resolution as opposed to the Import filters (177.26 KB, image/jpeg)
2023-07-17 23:30 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lij1478 2023-06-22 04:37:09 UTC
Description:
当我用 LibreOffice Draw 打开一些 PDF 的时候,出现奇怪的错误,比如 PDF 部分内容会被黑色方块块取代等。
其它软件几乎没有这样的错误

Deepl's translation results: 
When I use LibreOffice Draw to open some PDFs, strange errors appear, such as parts of the PDF will be replaced by black squares blocks, etc..
Other software almost no such errors

Steps to Reproduce:
1. 使用 LibreOffice Draw 打开某些 PDF。(Use LibreOffice Draw to open some PDFs.)

Actual Results:
部分内容被黑色方块取代(Part of the content is replaced by black squares)

Expected Results:
内容正常加载(The content loads normally)


Reproducible: Always


User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: zh-CN
Module: DrawingDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes

------------

The information from menu Help - About LibreOffice:

Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.utf8); UI: zh-CN
7.5.3-2
Calc: threaded

------------

我遇到的出问题的 PDF 都由 Google Chrome 生成。
(Deepl's translation results: The problematic PDFs I encountered were all generated by Google Chrome.)
Comment 1 lij1478 2023-06-22 05:47:07 UTC
Created attachment 188049 [details]
One PDF that could not be loaded properly with LibreOffice Draw
Comment 2 lij1478 2023-07-08 08:06:34 UTC
Created attachment 188257 [details]
BUG 复现(BUG Reproduction)
Comment 3 raal 2023-07-17 21:58:13 UTC
Confirm with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 663db89378aa1f0425e795ef5d471f134e658dc4
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

and Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 4 V Stuart Foote 2023-07-17 23:23:30 UTC
Nothing new here.

This is mostly caused by mismatch between the font names recorded to the PDF and the font names as installed  to your system.  The names don't match and the os attempts fall back replacment.  When imported to Draw, we don't make much use of the minimal font set recorded into the PDF, and the rest of the draw objects get fallback which may or maynot result in good quality rendering of the text runs--even more of an issue with CJK fonts.

However, the project also provides the Chromium projects "pdfium" based insert filter. Because it uses the exact fonts for strings contained in the PDF it can render with very good fidelity to the original PDF.  The default resolution is set low for performance, but can be increased by setting a PDFIMPORT_RESOLUTION_DPI environment variable. Insertion of the PDF as an image at 600 dpi or 1200 dpi will satisfy most work flows for high quality rendering of PDF to an ODF document canvas.

So, give the pdfium "Insert" filter a test. Issues with the PDF "Import" filter are unlikely to be fixed, especially the odd results for multi-byte glyph text streams.
Comment 5 V Stuart Foote 2023-07-17 23:30:15 UTC
Created attachment 188421 [details]
no issue with PDF with Insert filter and 600dpi resolution as opposed to the Import filters