Bug 167056 - PDF file can not be imported into Draw normally since Libreoffice 25.x.x.x
Summary: PDF file can not be imported into Draw normally since Libreoffice 25.x.x.x
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
25.2.4.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2025-06-17 02:25 UTC by lordarthas1995
Modified: 2025-07-13 16:05 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Abnormal importing PDF (298.41 KB, image/png)
2025-06-17 02:28 UTC, lordarthas1995
Details
Normal importing PDF by Libreoffice 24.x.x.x (363.07 KB, image/png)
2025-06-17 02:29 UTC, lordarthas1995
Details
Sample file (131.88 KB, application/pdf)
2025-06-17 09:51 UTC, lordarthas1995
Details
I/O error message (14.74 KB, image/png)
2025-06-30 17:27 UTC, Zerofino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lordarthas1995 2025-06-17 02:25:18 UTC
Description:
When I tried using Libreoffice 25.x.x to edit my diagram PDF file, I found that something are disappeared. But everything is working well in using Libreoffice 24.x.x.x and early version

Steps to Reproduce:
1.Importing a diagram PDF file which is larger than default (A4) size into Draw.


Actual Results:
Those parts out of A4 size background are disappeared.

Expected Results:
Whole diagram or painting should appear.


Reproducible: Always


User Profile Reset: No

Additional Info:
If you want, I can send my diagram pdf generated by Matlab to you
Comment 1 lordarthas1995 2025-06-17 02:28:11 UTC
Created attachment 201321 [details]
Abnormal importing PDF
Comment 2 lordarthas1995 2025-06-17 02:29:13 UTC
Created attachment 201322 [details]
Normal importing PDF by Libreoffice 24.x.x.x
Comment 3 m_a_riosv 2025-06-17 03:05:23 UTC
Please test in safe mode, Menu/Help/Restart in Safe Mode

Please attach a sample file, reduce the size as much as possible without private information,
and paste the information in Menu/Help/About LibreOffice, there is a copy icon.
Comment 4 lordarthas1995 2025-06-17 09:50:46 UTC
(In reply to m_a_riosv from comment #3)
> Please test in safe mode, Menu/Help/Restart in Safe Mode
> 
> Please attach a sample file, reduce the size as much as possible without
> private information,
> and paste the information in Menu/Help/About LibreOffice, there is a copy
> icon.

The sample file is uploaded now. Please try importing it into Libreoffice 24.x.x.x and 25.x.x.x separately
Comment 5 lordarthas1995 2025-06-17 09:51:31 UTC
Created attachment 201324 [details]
Sample file
Comment 6 Alex Thurgood 2025-06-17 11:35:48 UTC
The PDF you uploaded has missing information on the left and right hand sides when I open it in Apple Preview, so to me, this doesn't look like a but in the LibreOffice import, but in the software that produced the PDF ?
Comment 7 Alex Thurgood 2025-06-17 11:36:45 UTC
(In reply to Alex Thurgood from comment #6)
> The PDF you uploaded has missing information on the left and right hand
> sides when I open it in Apple Preview, so to me, this doesn't look like a
> but in the LibreOffice import, but in the software that produced the PDF ?

I would add that I see the same problem in Adobe PDF Viewer on macOS.
Comment 8 Regina Henschel 2025-06-17 19:15:24 UTC
The attached pdf file opens with all parts (e.g. 5 charts) in Version: 24.8.3.2 (X86_64) / LibreOffice Community
Build ID: 48a6bac9e7e268aeb4c3483fcf825c94556d9f92
CPU threads: 32; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded

There are parts missing when opening in Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: e24aa1d0f692cb6d64c00353356b0731e9afbadc
CPU threads: 32; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded

Since LibreOffice was able to handle the file in 24.8 regardless of any errors in the file and now can no longer do it properly, that is a regression in LibreOffice for me.
Comment 9 Telesto 2025-06-17 19:42:34 UTC
Marking to NEW for now (comment 8), so a bibisect can be done to identify the cause. 

If it's a true bug can be decided later. The PDF renders broken in multiple PDF viewers..
Comment 10 Saburo 2025-06-18 03:30:01 UTC
bibisected with win64-25.8

author	Dr. David Alan Gilbert
commit abfbca2719767516d5a35ee641ddd0d96d93e4ea

tdf#85428: Clip strokes
Clip stroke paths coming from the PDF import.
Similar to my previous patches for fills.

(It's possible we might have to do something clever with cropping
of arrows/etc but not sure yet)

Change-Id: I9e46deac4a722e3ac510f0cc4bdb6b38b67c579e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176952
Comment 11 lordarthas1995 2025-06-18 12:54:23 UTC
(In reply to Alex Thurgood from comment #6)
> The PDF you uploaded has missing information on the left and right hand
> sides when I open it in Apple Preview, so to me, this doesn't look like a
> but in the LibreOffice import, but in the software that produced the PDF ?

It is a diagram file generated by Matlab with PDF format. Unfortunately, in the most used PDF viewer softwares, it looks like being cut.
Comment 12 Zerofino 2025-06-30 17:20:22 UTC
I have a similar problem. Version 25.2.4 simply cannot open any PDF any more. I shall add the error message, which appears for each attempt.
I have to go back to version 24.
Comment 13 Zerofino 2025-06-30 17:27:33 UTC
Created attachment 201568 [details]
I/O error message

May be there is still a difference to the bug reported originally, because I am using MacOS for ARM.
Comment 14 V Stuart Foote 2025-07-13 15:31:54 UTC
@David, you may not have seen this regression report as some old email (dgilbert@redhat.com) was used following the bisection...
Comment 15 Dave Gilbert 2025-07-13 15:53:31 UTC
(In reply to Zerofino from comment #12)
> I have a similar problem. Version 25.2.4 simply cannot open any PDF any
> more. I shall add the error message, which appears for each attempt.
> I have to go back to version 24.

Hi Zerofino,
  I think you'll find that is a different bug, and it is this one:
     https://bugs.documentfoundation.org/show_bug.cgi?id=167080

  the fix went in a few days ago.
Comment 16 Dave Gilbert 2025-07-13 16:05:11 UTC
(In reply to Saburo from comment #10)
> bibisected with win64-25.8
> 
> author	Dr. David Alan Gilbert
> commit abfbca2719767516d5a35ee641ddd0d96d93e4ea
> 
> tdf#85428: Clip strokes
> Clip stroke paths coming from the PDF import.
> Similar to my previous patches for fills.
> 
> (It's possible we might have to do something clever with cropping
> of arrows/etc but not sure yet)
> 
> Change-Id: I9e46deac4a722e3ac510f0cc4bdb6b38b67c579e
> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176952

Thanks Stuart for copying my present self in.

OK, I believe that with that change the behaviour is now _correct_ - as Alex say in comment 6 & 7 it matches what Apple PDF viewer shows, and for me what Okular shows.

To me it looks like the original PDF file is misgenerated; it looks like a landscape document printed on portrait 'paper'; and what all the pdf viewers are doing (including LO with that patch) is they're clipping the PDF to the page bounding box.

Now, it's not perfect still - while we're correctly cropping out the graphics that have spilled over, we've not cropped the text that's outside the bounds yet; that's a known bug that we've not got any text cropping.  (That does confuse things a little since that looks like we've accidentally lost some components!)  tdf#86211 includes the text not getting clipped.

So setting resolved->notabug