[Bug 64876] New: Unable to convert pptx to pdf

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64876] New: Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

            Bug ID: 64876
           Summary: Unable to convert pptx to pdf
           Product: POI
           Version: 4.1.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSLF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

When tried converting pptx to pdf we get the below error

java.lang.RuntimeException: invalid wmf file - window records are incomplete.
        at
org.apache.poi.hwmf.usermodel.HwmfPicture.getBounds(HwmfPicture.java:182)
        at org.apache.poi.hwmf.usermodel.HwmfPicture.draw(HwmfPicture.java:134)
        at
org.apache.poi.hwmf.draw.HwmfImageRenderer.drawImage(HwmfImageRenderer.java:129)
        at
org.apache.poi.sl.draw.DrawPictureShape.drawContent(DrawPictureShape.java:64)
        at
org.apache.poi.sl.draw.DrawSimpleShape.draw(DrawSimpleShape.java:107)
        at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:71)
        at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
        at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:50)
        at org.apache.poi.sl.draw.DrawSlide.draw(DrawSlide.java:41)
        at org.apache.poi.xslf.usermodel.XSLFSlide.draw(XSLFSlide.java:373)
        at com.test.PPTxConverter.convertToPDFOld(PPTxConverter.java:75)
        at com.test.PPTxConverter.main(PPTxConverter.java:161)

The same implementation works fine with 3.15 , 3.12 versions.

The implementation is similar to
https://github.com/yeokm1/docs-to-pdf-converter/blob/master/docs-to-pdf-converter/src/com/yeokhengmeng/docstopdfconverter/PptxToPDFConverter.java

We need to upgrade to 4.x as the older versions have few vulnerabilities.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

Andreas Beeker <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #1 from Andreas Beeker <[hidden email]> ---
please add the failing .pptx or send it to my apache email. I need to check the
embedded WMF.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #2 from Suhail Zamir <[hidden email]> ---
Thanks for your prompt response Andreas.
Those pptx files are internal and confidential. And now I verified pptx files
without the WMF files related to our org, they are being converted fine.

I will try to get an approval and share it with you, or try to recreate a one
with similar wmf and without any confidential data and share it.

Thanks again.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #3 from Suhail Zamir <[hidden email]> ---
Created attachment 37546
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37546&action=edit
sample pptx file with issue

Hi Andreas,

Attaching the sample pptx file with the issue for your reference.

Thanks,
Suhail Zamir

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

Andreas Beeker <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Andreas Beeker <[hidden email]> ---
If you use the trunk version, it will recognize the WMF file as EMF.
Apart of that, it's one of those images where the inner bounds don't match the
outer bounds - therefore you need to use the -emfHeaderBounds (only in the
trunk yet) with PPTX2PNG or set
graphics.setRenderingHint(Drawable.EMF_FORCE_HEADER_BOUNDS, true).


To verify the bounds issue above, you can use PPTX2PNG with -dump <output.json>
option. The view bounds are (0,0,1879,357)...

>},{   /* setViewportOrgEx - index: 4 */
>  "origin": { "x": 0.0, "y": 0.0 }
>},{   /* setWindowExtEx - index: 5 */
>  "size": { "width": 1879.0, "height": 357.0 }
>},{   /* setViewportExtEx - index: 6 */
>  "extents": { "width": 1879.0, "height": 357.0 }

but later on you see something like this ... which is outside that view:

> { "type": "move", "x": 2154.0, "y": 638.0 }


Currently I can't distinguish between images which header bounds are just
describing the smallest bounds around the graphics and header bounds correctly
specifying the placement of the image. Especially with EMFs nested in EMFs the
header bounds seem to be ignored.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #5 from Suhail Zamir <[hidden email]> ---
Thanks Andreas,

In which future version can we expect this issue to be addressed?
As in all lower versions where this issue is not occurring, there are security
vulnerabilities, so downgrading is also not an option here.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #6 from Andreas Beeker <[hidden email]> ---
(In reply to Suhail Zamir from comment #5)
> In which future version can we expect this issue to be addressed?

POI 5.0.0 will be released in December, I guess.
Please test-drive the nightly as described in [1] ("instructions to run") and
send us/me feedback, if you have further issues.


[1] http://poi.apache.org/components/slideshow/ppt-wmf-emf-renderer.html

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #7 from Suhail Zamir <[hidden email]> ---
Sure Andreas,

We will verify and provide the feedback soon.

Thanks,
Suhail Zamir

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #8 from Suhail Zamir <[hidden email]> ---
Created attachment 37553
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37553&action=edit
Converted using 5.x

Hi Andreas,

Now we are able to convert those pptx files. The WMF images which were causing
issues while conversion are also converted correctly when the flag
-emfHeaderBounds is added.

But we are not able to view the converted files in Acrobat Reader. I have
attached the error.

Thanks,
Suhail Zamir

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #9 from Andreas Beeker <[hidden email]> ---
I've only tested with the typical tools in Linux.
So Chrome is also complaining about that file?

Are you saving the file straight away to the disc or is there some webservice
in-between which prematurely closes the stream?

Can you provide the input-pptx to me privately?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #10 from Suhail Zamir <[hidden email]> ---
Hi Andreas,

I am using the PPTX2PNG tool to convert it. And chrome doesn't show any error.

You can try the same with the PPTX I shared earlier.

Thanks,
Suhail Zamir

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #11 from Andreas Beeker <[hidden email]> ---
Created attachment 37559
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37559&action=edit
PDF checker result

PDF checker [1] didn't find any issues.
You can compare your output with mine and you can upload the file to
pdf-checker to see if there are any issues.

if there aren't issues report and it still doesn't work ... I'll try to install
adobe reader and see for myself ...

[1] https://www.datalogics.com/products/pdf-tools/pdf-checker/

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #12 from Suhail Zamir <[hidden email]> ---
Created attachment 37562
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37562&action=edit
Issue with acrobat reader

Attaching the pdf file converted using PPTX2PNG tool with issue.
Same opens fine in chrome.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #13 from Suhail Zamir <[hidden email]> ---
Created attachment 37563
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37563&action=edit
pdf checker output of test4.pdf

There seem to be no issues with this pdf as well. Attaching the pdf checker
output

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

--- Comment #14 from Suhail Zamir <[hidden email]> ---
Hi Andreas,

Did you get a chance to verify this on acrobat reader?

Thanks,
Suhail Zamir

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64876] Unable to convert pptx to pdf

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64876

Andreas Beeker <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #15 from Andreas Beeker <[hidden email]> ---
Yes I did.
I've opened it in Acrobat 6.0 and it complained about Type 3 fonts, i.e. it
doesn't like embedded PS fonts. I haven't yet tried to fix it, as I'm busy with
fixing EMF/WMF related issues.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]