Bug 57766 - XSLFTable isn't exported on convert slides of a .pptx slide show to a PNG/SVG image
Summary: XSLFTable isn't exported on convert slides of a .pptx slide show to a PNG/SVG...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.11-FINAL
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-27 11:59 UTC by Wu Huajie
Modified: 2016-06-05 01:19 UTC (History)
2 users (show)



Attachments
original report (48.50 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2015-03-27 11:59 UTC, Wu Huajie
Details
the result svg (1.28 KB, image/svg+xml)
2015-03-27 12:01 UTC, Wu Huajie
Details
the result of png (7.39 KB, image/png)
2015-03-27 12:04 UTC, Wu Huajie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wu Huajie 2015-03-27 11:59:52 UTC
Created attachment 32612 [details]
original report

I'm trying to convert slides of a .pptx slide show to a PNG image.

it works fine until there are table on pptx.

As the result, other parts are exported correctly, while the table is not shown in the result of png/svg.

I have attached the original report and the result. 

My code is according 
https://svn.apache.org/repos/asf/poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
and
http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PPTX2SVG.txt.

Anyone can help?
Comment 1 Wu Huajie 2015-03-27 12:01:44 UTC
Created attachment 32613 [details]
the result svg
Comment 2 Wu Huajie 2015-03-27 12:04:02 UTC
Created attachment 32614 [details]
the result of png
Comment 3 Andreas Beeker 2015-03-27 13:44:41 UTC
Table drawing is currently not implemented.

I'm currently rewriting the drawing part (see common_sl snapshot), but it still will take some time until this is finished and then I put this feature on my todo list.

Andi
Comment 4 Wu Huajie 2015-03-29 07:22:15 UTC
May i know the approximate time to implement this feature?

Table is popular part in a PPTX.  Otherwise, i need to search other solutions.

Thanks a lot.
Comment 5 Andreas Beeker 2015-03-29 14:57:53 UTC
> May i know the approximate time to implement this feature?
I guess it won't be finished within the next 2 month and even after finishing my current work, I don't know if this will be the first item on my todo list.

> Table is popular part in a PPTX.
yeah, that's what I think also about a feature XY, and then after I've patched/implemented it, nobody uses it :)

> Otherwise, i need to search other solutions.
Your best bet is to implement it yourself, and please upload the patch here - I'm thankfully adapting your code to the new rendering classes then. Otherwise maybe check aspose.slides if this feature was implemented there.
Comment 6 Wu Huajie 2015-04-06 08:14:56 UTC
(In reply to Andreas Beeker from comment #5)
> > May i know the approximate time to implement this feature?
> I guess it won't be finished within the next 2 month and even after
> finishing my current work, I don't know if this will be the first item on my
> todo list.
> 
> > Table is popular part in a PPTX.
> yeah, that's what I think also about a feature XY, and then after I've
> patched/implemented it, nobody uses it :)
> 
Sorry to hear that. Is this feature not used widely? How others do about the pptx to png/svg?

No worry. I'm on you. I'll use it when you implement it. :)


> > Otherwise, i need to search other solutions.
> Your best bet is to implement it yourself, and please upload the patch here
> - I'm thankfully adapting your code to the new rendering classes then.
> Otherwise maybe check aspose.slides if this feature was implemented there.

Thanks for providing this information.
Comment 7 Wu Huajie 2015-04-10 02:39:48 UTC
(In reply to Andreas Beeker from comment #5)
> > May i know the approximate time to implement this feature?
> I guess it won't be finished within the next 2 month and even after
> finishing my current work, I don't know if this will be the first item on my
> todo list.
> 
> > Table is popular part in a PPTX.
> yeah, that's what I think also about a feature XY, and then after I've
> patched/implemented it, nobody uses it :)
> 
> > Otherwise, i need to search other solutions.
> Your best bet is to implement it yourself, and please upload the patch here
> - I'm thankfully adapting your code to the new rendering classes then.
> Otherwise maybe check aspose.slides if this feature was implemented there.


As your experience, how many days would it take for me, if you guide me,  to implement this feature: export table to png?
Comment 8 mark.o 2015-05-08 06:14:20 UTC
(In reply to Andreas Beeker from comment #3)
> Table drawing is currently not implemented.

> I'm currently rewriting the
> drawing part (see common_sl snapshot), but it still will take some time
> until this is finished and then I put this feature on my todo list.

(off-topic or maybe related, or maybe needs to be asked elsewhere?)

Does the creation of a XSLFTable actually work?
I used the XSLSSlide.createTable followed by
  -> addRow  (+ setHeight)
  -> addCell
  -> addNewTextParagraph
  -> addNewTextRun -> setText
as well as the table setColumnWidth()

In the generated PPTX, only the table itself comes through without any content (no rows, no cells).
Unzipping the content shows the same - no content.
Comment 9 Andreas Beeker 2016-06-05 01:19:08 UTC
Implemented via r1746856
Of course there are still a lot of tables, which aren't rendered correctly, but 
it should be ok for the usual suspects ...

Regarding the table creation - the example [1] worked for me.
I had to fix a regression introduced via r1745100 and fixed by r1746858
The table handling you've mentioned is also tested via [2]
Maybe you need to use the complete ooxml-schema.jar, i.e. I haven't tested it 
in a standalone app.

Andi

[1] 
https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
[2] 
https://svn.apache.org/repos/asf/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java