Bug 153974 - Wrong choice of page margins when importing a PDF with a shape
Summary: Wrong choice of page margins when importing a PDF with a shape
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2023-03-04 20:21 UTC by Eyal Rozenberg
Modified: 2023-11-28 15:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Writer-exported PDF with wrong margins (13.52 KB, application/pdf)
2023-03-04 20:21 UTC, Eyal Rozenberg
Details
The original Writer document (12.70 KB, application/vnd.oasis.opendocument.text)
2023-03-04 20:23 UTC, Eyal Rozenberg
Details
PDF export with LTR (14.49 KB, application/pdf)
2023-11-16 03:47 UTC, Kira Tubo
Details
original writer file with rectangle shape (9.19 KB, application/vnd.oasis.opendocument.text)
2023-11-16 03:53 UTC, Kira Tubo
Details
rectangle exported pdf (1.73 KB, application/pdf)
2023-11-16 03:54 UTC, Kira Tubo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2023-03-04 20:21:22 UTC
Created attachment 185756 [details]
Writer-exported PDF with wrong margins

Consider the attached PDF, exported from Writer. It has A4 paper size, one RTL paragraph (with LTR text), and a horizontal line between the text boundaries. Its margins are 2 cm on each side.

However, when we open the document in Draw, we get margins of:

From left:   1.90 cm
From right:  1.00 cm
From top:    2.00 cm
From bottom: 4.00 cm

which is both wrong and nonsensical. The content is placed reasonably, however - it's just at an offset from the right margin.

Seen with:

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Comment 1 Eyal Rozenberg 2023-03-04 20:22:47 UTC
Note: Not seeing that behavior using the Writer PDF import filter.
Comment 2 Eyal Rozenberg 2023-03-04 20:23:04 UTC
Created attachment 185757 [details]
The original Writer document
Comment 3 Kira Tubo 2023-11-16 03:47:04 UTC
Created attachment 190851 [details]
PDF export with LTR

Hmmm, I don't think RTL is the issue. If I export the same file, aligning the text to LTR, the margins are the same as the RTL file. 

It might have to do with the horizontal bar in the document. I get the similar (if not worse) results with a simple rectangle shape created from Writer. I will attach sample files shortly.
Comment 4 Kira Tubo 2023-11-16 03:53:22 UTC
Created attachment 190852 [details]
original writer file with rectangle shape

Steps: 

1. Open Writer
2. Insert rectangle shape
3. Export as PDF
4. Open file created in step 3 in Draw

Result: margins in Draw do not match the margins from Writer.
Comment 5 Kira Tubo 2023-11-16 03:54:02 UTC
Created attachment 190853 [details]
rectangle exported pdf
Comment 6 Buovjaga 2023-11-28 12:53:36 UTC
It's the same result in the oldest of Linux 43all bibisect repo. I should ask about this in the dev chat.