ASF Bugzilla – Attachment 35318 Details for
Bug 61515
Removing last slide then appending new slide leads to corrupted PowerPoint file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Minimal Java repro case
CorruptedPowerPointDocument.java (text/plain), 983 bytes, created by
François Beaune
on 2017-09-12 08:39:24 UTC
(
hide
)
Description:
Minimal Java repro case
Filename:
MIME Type:
Creator:
François Beaune
Created:
2017-09-12 08:39:24 UTC
Size:
983 bytes
patch
obsolete
>import java.io.FileInputStream; >import java.io.FileOutputStream; > >import org.apache.poi.xslf.usermodel.SlideLayout; >import org.apache.poi.xslf.usermodel.XMLSlideShow; >import org.apache.poi.xslf.usermodel.XSLFSlideLayout; >import org.apache.poi.xslf.usermodel.XSLFSlideMaster; > >public class CorruptedPowerPointDocument { > public static void main(String[] args) { > try { > FileInputStream inputStream = new FileInputStream("input.pptx"); > XMLSlideShow ppt = new XMLSlideShow(inputStream); > > XSLFSlideMaster master = ppt.getSlideMasters().get(0); > XSLFSlideLayout layout = master.getLayout(SlideLayout.BLANK); > > ppt.removeSlide(0); > ppt.createSlide(layout); > > FileOutputStream out = new FileOutputStream("output.pptx"); > ppt.write(out); > out.close(); > } catch (Exception ex) { > System.out.println(ex.getMessage()); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 61515
: 35318 |
35319
|
35320