Bug 161778 - [PDF] CSS overflow and text alignment issues
Summary: [PDF] CSS overflow and text alignment issues
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.2.4.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2024-06-25 14:23 UTC by source_a
Modified: 2024-06-26 13:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
The PDF generated with Gotenberg (16.79 KB, application/pdf)
2024-06-25 14:23 UTC, source_a
Details
PDF saved from Chromium print dialog (8.04 KB, application/pdf)
2024-06-25 15:09 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description source_a 2024-06-25 14:23:16 UTC
Created attachment 194948 [details]
The PDF generated with Gotenberg

My final goal is to generate a PDF of type PDF/A. I use Gotenberg to generate this kind of PDF from HTML code, who uses your soft in order to convert PDF into PDF/A. I created an issue on their repo originally, and they redirected me to you: https://github.com/gotenberg/gotenberg/issues/911

You can find in the issue the HTML code used to generate the PDF file in attachment.

When I open this PDF in LibreOffice generated from Gotenberg, the rendering does not correspond to what is expected. The text is not justified, and the elements overflow from the main container which contains the overflow: hidden property. If I open this PDF with another PDF viewer, all is OK.

See in the resulted PDF file before PDF/A conversion.

Thanks.
Comment 1 Buovjaga 2024-06-25 15:09:38 UTC
Created attachment 194950 [details]
PDF saved from Chromium print dialog

Bad idea for this gotenberg software to treat PDF as a format you re-open and re-save. PDF is an export-only format.
Comment 2 V Stuart Foote 2024-06-25 20:49:27 UTC
LibreOffice "native" documents are to OASIS ODF 1.3 standard (as extended).

ALL Other formats are non-native and make use of import/export filters.

PDF has two filters available for import: poppler based PDF read into cairo libs to render into LO drawing objects, and pdfium libs to render to raster image with high fidelity to original PDF.

With either filter path a PDF is not editable in LibreOffice and depending on need inserting as an image may be more useful to import as LO draw shapes and text boxes.

If you start with an ODF document, or just the text from some external format, Writer can print/export to PDF/A

No such handling for round-trip of a PDF.

Specific issue of CSS handling in PDF/A is Not Our Bug. If there were an issue it would be with poppler or the pdfium project. But mute as this is out of scope for LO ODF usage.

=> WF
Comment 3 V Stuart Foote 2024-06-25 20:59:04 UTC
Just checked and the pdfium based Insert -> Image filter handling of the PDF delivers a well formed rendering of the PDF.  While the poppler -> cairo based Import "open" of the attachment 194948 [details] PDF exhibits the same overflow of the gotenberg processor.

Still not in scope for LibreOffice, and a clear => WF
Comment 4 source_a 2024-06-26 08:59:07 UTC
So if I understand correctly, the problem comes from the Poppler library. I will try to open a bug report on their repository. Are there any specific details I should provide about how you are using it in this particular case?
Thanks
Comment 5 V Stuart Foote 2024-06-26 12:14:09 UTC
@Miklos, any suggestion for the OP
Comment 6 Miklos Vajna 2024-06-26 13:58:36 UTC
I'm not really familiar with our poppler code; I would just echo what Buovjaga wrote in comment 1: best to assume that once you created a PDF, you can only annotate it, you can't edit it. (export-only/append-only format).