How to copy a Chart from another .PPTX file?
Posted: Tue Feb 28, 2012 12:20 pm
Hi,
I'm still working on PPTX document copy, and I have troubles with charts.
It works fine when I copy a Chart part, but when I try to add an embedded XLSX object, I see following line in the log:
It comes right after doing this:
SaveToZipFile throws an Exception:
When I try to add this embedded XLSX object directly to the SlidePart, it doesn't throw any exception, but PowerPoint says that file is corrupted.
However, it is able to recovery, and displays this file correctly, but it's not a solution.
Is there any special processing for Charts or embedded objects?
Any help is appreciated.
Thanks you.
Dmitriy.
I'm still working on PPTX document copy, and I have troubles with charts.
It works fine when I copy a Chart part, but when I try to add an embedded XLSX object, I see following line in the log:
- Code: Select all
org.docx4j.openpackaging.parts.relationships.RelationshipsPart - True - will delete relationship with target ../embeddings/Microsoft_Office_Excel_Worksheet1.xlsx
It comes right after doing this:
- Code: Select all
chartPart.addTargetPart(xlsxPart);
SaveToZipFile throws an Exception:
- Code: Select all
org.docx4j.openpackaging.exceptions.Docx4JException: Failed to add parts from relationships
at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:334)
at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:159)
at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:88)
...
When I try to add this embedded XLSX object directly to the SlidePart, it doesn't throw any exception, but PowerPoint says that file is corrupted.
However, it is able to recovery, and displays this file correctly, but it's not a solution.
Is there any special processing for Charts or embedded objects?
Any help is appreciated.
Thanks you.
Dmitriy.