Bug 147642 - Some equation elements not imported correctly from PDF
Summary: Some equation elements not imported correctly from PDF
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2022-02-24 15:27 UTC by Sylvain RIGAL
Modified: 2022-12-15 15:59 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Beamer generated PDF to convert (67.49 KB, application/pdf)
2022-02-24 15:31 UTC, Sylvain RIGAL
Details
Tex file to generate the PDF to convert (956 bytes, text/plain)
2022-02-24 15:32 UTC, Sylvain RIGAL
Details
Final output PPT (562.50 KB, application/vnd.ms-powerpoint)
2022-02-24 15:34 UTC, Sylvain RIGAL
Details
attachment 178513 as PPT (via pdfium insert to canvas and save-as work flow) (1.07 MB, application/vnd.ms-powerpoint)
2022-12-15 15:59 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain RIGAL 2022-02-24 15:27:50 UTC
Description:
Some part of equation ("big" parenthesis and "big" square root) are not well converted with a PDF to PPT conversion (and also PDF to ODP conversion).

See this question on ask.libreoffice.org: https://ask.libreoffice.org/t/error-with-soffice-ms-powerpoint-97-filter-conversion/74112

I used the following command line: soffice --infilter=impress_pdf_import --convert-to ppt myPDFtoconvert.

I precise that the PDF was generated with LaTeX Beamer (I can provide the Beamer code if necessary).

Steps to Reproduce:
1. Generate a PDF (called "MWE.pdf") using Beamer with the following LaTeX code and LuaLatex engine (if possible the last LaTeX distribution as Texlive 2021 for exemple):
```
\documentclass{beamer}
\usepackage{amsmath}
\begin{document}
\begin{frame}{Equations}
         \begin{subequations}
            \begin{align}
                {ErrIm}(i) =  \frac{abs \left( Im_{Ny_1}(i) - Im_{Ny_2}(i) \right)}{\frac{ max \left( abs \left( Im_{Ny_1} \right) \right) + max \left( abs \left( Im_{Ny_2} \right) \right) }{2}} \times 100 \\
               {ErrRe}(i) =  \frac{abs \left( Re_{Ny_1}(i) - Re_{Ny_2}(i) \right)}{\frac{ max \left( abs \left( Re_{Ny_1} \right) \right) + max \left( abs \left( Re_{Ny_2} \right) \right) }{2}} \times 100 
            \end{align}
            \end{subequations}

            \begin{subequations}
            \begin{align}
                S =  \sqrt{\frac{1}{N-1}\sum_{i=1}^{N} \lvert  A(i) - \mu \rvert ^2}  \\
                \text{avec $\mu$ la moyenne de $A$ : \ \ }
                \mu =  \frac{1}{N}\sum_{i=1}^{N} A(i) 
            \end{align}
            \end{subequations}
\end{frame}
\end{document}
```
2. Convert the PDF with this command line: soffice --infilter=impress_pdf_import --convert-to ppt MWE.pdf
3. Open the PPT file with Impress or Power Point

Actual Results:
You will see that somme parenthesis are not present in the PPT file ("abs" function and "max" function) and also the square root after the "S ="

Expected Results:
The PPT should be equivalent to the PDF regarding to the parenthesis and square root in equations.


Reproducible: Always


User Profile Reset: No



Additional Info:
I use Ubuntu 20.04 LTS on a Windows Subsystem Linux.
I can't check is OpenGL is enabled.
I didn't resetting my UserProfile because this bug was reproduced by a LibreOffice core developer in this question on ask.libreoffice.org: https://ask.libreoffice.org/t/error-with-soffice-ms-powerpoint-97-filter-conversion/74112
Comment 1 Sylvain RIGAL 2022-02-24 15:31:12 UTC
Created attachment 178513 [details]
Beamer generated PDF to convert

The Beamer LaTeX genereted PDF to convert to PPT
Comment 2 Sylvain RIGAL 2022-02-24 15:32:13 UTC
Created attachment 178514 [details]
Tex file to generate the PDF to convert

Tex file to compile with LuaLatex in order to generate the PDF to convert to PPT
Comment 3 Sylvain RIGAL 2022-02-24 15:34:27 UTC
Created attachment 178515 [details]
Final output PPT

The final PPT file after conversion from PDF
Comment 4 Timur 2022-02-25 06:53:50 UTC
Those using conversion report their problem, but really simple GUI fileopen of source document should be tested first to see if big is about that. 
Than, GUI and command line save as ODF.
Comment 5 Sylvain RIGAL 2022-02-25 07:07:18 UTC
Ok, copy that. I got exactly the same behaviour when opening the PDF with Impress GUI on Windows 10 (which redirect automaticly to Draw).
Comment 6 Sylvain RIGAL 2022-02-25 07:07:46 UTC
(In reply to Timur from comment #4)
> Those using conversion report their problem, but really simple GUI fileopen
> of source document should be tested first to see if big is about that. 
> Than, GUI and command line save as ODF.

Ok, copy that. I got exactly the same behaviour when opening the PDF with Impress GUI on Windows 10 (which redirect automaticly to Draw).
Comment 7 Buovjaga 2022-12-15 12:48:24 UTC
Repro with PDF. Same with 3.3.0 and 6.3.0.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9b46020c262045aed0beace4708565235c2523cc
CPU threads: 2; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded Jumbo

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a365b4850299778992350c690b064728be6b74ef
CPU threads: 8; OS: Linux 6.0; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded Jumbo
Built on 15 December 2022
Comment 8 V Stuart Foote 2022-12-15 15:59:00 UTC
Created attachment 184161 [details]
attachment 178513 [details] as PPT (via pdfium insert to canvas and save-as work flow)

Seems to be wrong work flow.

LibreOffice is not a PDF editor and PDF is not an editable format.

We offer 100% fidelity via pdfium when the PDF is correctly inserted as an image to Presentation or Drawing or even a Text document.

Attached the attached PDF converted to PPT with a pdfium based handling.

If you need to use LibreOffice to prepare PPT or PPTX slides, the ODF Presentation can be 'Save-as' to that format. 

Otherwise, there is no expectation that a PDF can be filter imported, or stream edited by filter, with 100% fidelity.  There is no MathML, StarMath or Latex syntax resident in the source PDF

IMHO => NAB