Bug 118797 - FILEOPEN PDF: Text elements incorrectly aligned (compared to PDF viewers)
Summary: FILEOPEN PDF: Text elements incorrectly aligned (compared to PDF viewers)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pdf
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2018-07-17 08:55 UTC by smrank
Modified: 2024-03-20 12:06 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
PDF testcase (in PDF viewers the text is aligned inside vertical lines) (4.49 KB, application/pdf)
2018-07-17 08:55 UTC, smrank
Details
Adobe Reader vs LibreOffice Draw rendering (Windows 10) (5.74 KB, image/png)
2018-07-17 08:56 UTC, smrank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description smrank 2018-07-17 08:55:05 UTC
Description:
The attached testcase PDF was generated from a report in Pegasus Opera (a UK accounts package). I temporarily modified the report to remove irrelevant information. Even though the original report has 4 separate text fields it seems like the PDF version combines the text fields together.

When loaded into a viewer the text aligns inside the lines (tested on Adobe Reader, Firefox, Chrome, & Edge). However when importing the testcase into LibreOffice Draw the text is not aligned in the same way. Whenever I edit a PDF generated from this report in Draw I manually fix this table by adding more spaces.

Steps to Reproduce:
1. File->Open and choose testcase.pdf.

Actual Results:
Text overlaps vertical lines (compared to PDF viewers and original report).

Expected Results:
Text inside vertical lines.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 6.0.5.2 (x64)
Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: en-GB (en_GB); Calc: group
Comment 1 smrank 2018-07-17 08:55:47 UTC
Created attachment 143590 [details]
PDF testcase (in PDF viewers the text is aligned inside vertical lines)
Comment 2 smrank 2018-07-17 08:56:58 UTC
Created attachment 143591 [details]
Adobe Reader vs LibreOffice Draw rendering (Windows 10)
Comment 3 V Stuart Foote 2018-07-17 12:46:52 UTC
Confirmed on Windows 10 Home 64-bit en-US with
Version: 6.0.5.2 (x64)
Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: en-US (en_US); Calc: CL

LibreOffice is not an editor for PDF. And our import filters are not expected to provide 100% fidelity when, during import, the elements of the PDF are broken into drawing objects on the Draw canvas. All text is present, as are the line elements and fill.

If fidelity to the source PDF is required, the PDF should be inserted as an image into any of the LO modules, using a different project filter based on pdfium. At present that filter will not support "break" of the PDF to its component elements.

IMHO => WF
Comment 4 Xisco Faulí 2018-07-18 18:19:19 UTC
Also reproduced in

Version: 5.0.0.0.alpha1+
Build ID: 0db96caf0fcce09b87621c11b584a6d81cc7df86
Locale: ca-ES (ca_ES.UTF-8)

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 5 Timur 2022-03-02 11:07:48 UTC
PDF text is "Arial,Bold" with Actual Font: Arial-BoldMT. LO 7.4+ reads just Arial.
Doesn't seem the case of embedded font, like in bug 85295.
Kevin, can you please explain the problem.
Comment 6 Kevin Suo 2022-03-02 11:47:00 UTC
(In reply to Timur from comment #5)
LibreOffice renders this pdf using "Arial" while correctly applying "bold" font style. You can observe the "bold" if you select the text in Draw and notice that in the side bar the bold is applied. As a result it is not a font problem.

The problem seems to be, in Draw it combined "CODE RATE% GOODS TOTALS" (i.e. the heading for the three columns) into a single text frame, while not given enough white spaces between the text in each column.
Comment 7 Stéphane Guillou (stragu) 2024-03-20 12:06:36 UTC
Reproduced in recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 53c5d570cab036b23f4969b858a648c8f0c24f93
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Tempted to close as duplicate of bug 49705, but if this particular case is coming from a table, might be a different issue.