@Beta public class XMLSlideShow extends POIXMLDocument implements SlideShow<XSLFShape,XSLFTextParagraph>
POIXMLDocumentPart.RelationPart
DOCUMENT_CREATOR, OLE_OBJECT_REL_TYPE, PACK_OBJECT_REL_TYPE
Constructor and Description |
---|
XMLSlideShow() |
XMLSlideShow(java.io.InputStream is) |
XMLSlideShow(OPCPackage pkg) |
Modifier and Type | Method and Description |
---|---|
XSLFFontInfo |
addFont(java.io.InputStream fontStream)
Add an EOT font to the slideshow.
(在幻灯片中添加 EOT 字体。)
|
XSLFPictureData |
addPicture(byte[] pictureData, PictureData.PictureType format)
Adds a picture to the workbook.
(将图片添加到工作簿。)
|
XSLFPictureData |
addPicture(java.io.File pict, PictureData.PictureType format)
Adds a picture to the presentation.
(在演示文稿中添加图片。)
|
XSLFPictureData |
addPicture(java.io.InputStream is, PictureData.PictureType format)
Adds a picture to the slideshow.
(将图片添加到幻灯片。)
|
protected void |
commit()
Save the content in the underlying package part.
(将内容保存在底层包部分中。)
|
XSLFChart |
createChart()
This method is used to create template for chart XML.
(此方法用于为图表 XML 创建模板。)
|
XSLFChart |
createChart(XSLFSlide slide)
Create a blank chart on the given slide.
(在给定的幻灯片上创建一个空白图表。)
|
MasterSheet<XSLFShape,XSLFTextParagraph> |
createMasterSheet() |
void |
createNotesMaster()
Create a notes master.
(创建笔记大师。)
|
XSLFSlide |
createSlide()
Create a blank slide using the default (first) master.
(使用默认(第一个)母版创建一张空白幻灯片。)
|
XSLFSlide |
createSlide(XSLFSlideLayout layout)
Create a slide and initialize it from the specified layout.
(创建一张幻灯片并从指定的布局对其进行初始化。)
|
XSLFSlideLayout |
findLayout(java.lang.String name)
Scan the master slides for the first slide layout with the given name.
(扫描母版幻灯片以查找具有给定名称的第一张幻灯片布局。)
|
XSLFPictureData |
findPictureData(byte[] pictureData)
check if a picture with this picture data already exists in this presentation
(检查此演示文稿中是否已存在具有此图片数据的图片)
|
java.util.List<PackagePart> |
getAllEmbeddedParts()
Get the document's embedded files.
(获取文档的嵌入文件。)
|
java.util.List<XSLFChart> |
getCharts()
Return all the charts in the slideshow
(返回幻灯片中的所有图表)
|
XSLFCommentAuthors |
getCommentAuthors()
Returns the list of comment authors, if there is one.
(返回评论作者列表(如果有的话)。)
|
org.openxmlformats.schemas.presentationml.x2006.main.CTPresentation |
getCTPresentation() |
java.util.List<XSLFFontInfo> |
getFonts() |
POIXMLPropertiesTextExtractor |
getMetadataTextExtractor() |
XSLFNotesMaster |
getNotesMaster()
Return the Notes Master, if there is one.
(返回 Notes Master,如果有的话。)
|
XSLFNotes |
getNotesSlide(XSLFSlide slide)
Return notes slide for the specified slide or create new if it does not exist yet.
(返回指定幻灯片的备注幻灯片,如果尚不存在则创建新幻灯片。)
|
java.awt.Dimension |
getPageSize()
Returns the current page size
(返回当前页面大小)
|
java.lang.Object |
getPersistDocument() |
java.util.List<XSLFPictureData> |
getPictureData()
Returns all Pictures of this slideshow.
(返回此幻灯片的所有图片。)
|
java.util.List<XSLFSlideMaster> |
getSlideMasters()
Returns all slide masters.
(返回所有幻灯片母版。)
|
java.util.List<XSLFSlide> |
getSlides()
Return all the slides in the slideshow
(返回幻灯片中的所有幻灯片)
|
XSLFTableStyles |
getTableStyles() |
protected void |
onDocumentRead()
Fired when a package part is read
(读取包部分时触发)
|
XSLFSlide |
removeSlide(int index) |
void |
setPageSize(java.awt.Dimension pgSize)
Change the current page size
(更改当前页面大小)
|
void |
setSlideOrder(XSLFSlide slide, int newIndex) |
close, getCorePart, getPackage, getProperties, getRelatedByType, load, openPackage, write
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
public XMLSlideShow()
public XMLSlideShow(OPCPackage pkg)
public XMLSlideShow(java.io.InputStream is) throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected void onDocumentRead() throws java.io.IOException
POIXMLDocumentPart
onDocumentRead
in class
POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException when a document is read
(java.io.IOException - 读取文档时子类可能会抛出 IOException)
protected void commit() throws java.io.IOException
POIXMLDocumentPart
Sub-classes should override and add logic to marshal the "model" into Ooxml4J.
For example, the code saving a generic XML entry may look as follows:
protected void commit() throws IOException { PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); out.close(); }(将内容保存在底层包部分中。默认实现是空的,这意味着包部分保持不变。子类应覆盖并添加逻辑以将“模型”编组到 Ooxml4J。例如,保存通用 XML 条目的代码可能如下所示: protected void commit() throws IOException { PackagePart part = getPackagePart();输出流输出 = part.getOutputStream(); XmlObject bean = getXmlBean(); //保存内存变化的“模型” bean.save(out, DEFAULT_XML_OPTIONS); out.close(); })
commit
in class
POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committed
(java.io.IOException - 如果无法提交更改,子类可能会抛出 IOException)
public java.util.List<PackagePart> getAllEmbeddedParts()
getAllEmbeddedParts
in class
POIXMLDocument
(类 POIXMLDocument 中的 getAllEmbeddedParts)
public java.util.List<XSLFPictureData> getPictureData()
SlideShow
List
is unmodifiable.
(返回此幻灯片的所有图片。返回的 List 是不可修改的。)
getPictureData
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(接口 SlideShow 中的 getPictureData
List
of
PictureData
.
(图片数据列表。)
public XSLFSlide createSlide(XSLFSlideLayout layout)
layout
- The layout to use for the new slide.
(layout - 用于新幻灯片的布局。)
public XSLFSlide createSlide()
createSlide
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 createSlide
public XSLFChart createChart(XSLFSlide slide)
public XSLFChart createChart()
public XSLFNotes getNotesSlide(XSLFSlide slide)
public void createNotesMaster()
public XSLFNotesMaster getNotesMaster()
public java.util.List<XSLFSlideMaster> getSlideMasters()
SlideShow
getSlideMasters
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 getSlideMasters
public java.util.List<XSLFSlide> getSlides()
getSlides
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 getSlides
public java.util.List<XSLFChart> getCharts()
public XSLFCommentAuthors getCommentAuthors()
public void setSlideOrder(XSLFSlide slide, int newIndex)
newIndex
- 0-based index of the slide
(newIndex - 从 0 开始的幻灯片索引)
public XSLFSlide removeSlide(int index)
public java.awt.Dimension getPageSize()
SlideShow
getPageSize
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 getPageSize
public void setPageSize(java.awt.Dimension pgSize)
SlideShow
setPageSize
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 setPageSize
pgSize
- page size (in points)
(pgSize - 页面大小(以磅为单位))
@Internal public org.openxmlformats.schemas.presentationml.x2006.main.CTPresentation getCTPresentation()
public XSLFPictureData addPicture(byte[] pictureData, PictureData.PictureType format)
addPicture
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(在界面幻灯片中添加图片
pictureData
- The bytes of the picture
(pictureData - 图片的字节数)
format
- The format of the picture.
(format - 图片的格式。)
public XSLFPictureData addPicture(java.io.InputStream is, PictureData.PictureType format) throws java.io.IOException
addPicture
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(在界面幻灯片中添加图片
is
- The stream to read image from
(is - 要从中读取图像的流)
format
- The format of the picture
(format - 图片的格式)
java.io.IOException
(java.io.IOException)
public XSLFPictureData addPicture(java.io.File pict, PictureData.PictureType format) throws java.io.IOException
addPicture
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(在界面幻灯片中添加图片
pict
- The file containing the image to add
(pict - 包含要添加的图像的文件)
format
- The format of the picture.
(format - 图片的格式。)
java.io.IOException
(java.io.IOException)
public XSLFPictureData findPictureData(byte[] pictureData)
findPictureData
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(在界面 SlideShow 中查找图片数据
pictureData
- The picture data to find in the SlideShow
(pictureData - 要在幻灯片中查找的图片数据)
null
if picture data is not found in this slideshow
(如果在此幻灯片中未找到图片数据,则为 null)
public XSLFSlideLayout findLayout(java.lang.String name)
name
- The layout name (case-insensitive). Cannot be null.
(name - 布局名称(不区分大小写)。不能为空。)
public XSLFTableStyles getTableStyles()
public MasterSheet<XSLFShape,XSLFTextParagraph> createMasterSheet() throws java.io.IOException
createMasterSheet
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 createMasterSheet
java.io.IOException
(java.io.IOException)
public POIXMLPropertiesTextExtractor getMetadataTextExtractor()
getMetadataTextExtractor
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(接口 SlideShow 中的 getMetadataTextExtractor
public java.lang.Object getPersistDocument()
getPersistDocument
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 getPersistDocument
POIDocument
or
POIXMLDocument
(处理幻灯片持久化的实例,它是 POIDocument 或 POIXMLDocument 的子类)
public XSLFFontInfo addFont(java.io.InputStream fontStream) throws java.io.IOException
SlideShow
(Older?) Powerpoint versions handle embedded fonts by converting them to .ttf files and put them into the Windows fonts directory. If the user is not allowed to install fonts, the slideshow can't be opened. While the slideshow is opened, its possible to copy the extracted .ttfs from the fonts directory. When the slideshow is closed, they will be removed.
(在幻灯片中添加 EOT 字体。 EOT 或 MTX 字体是转换后的 True-Type (.ttf) 或 Open-Type (.otf) 字体。要转换 True-Type 字体,请使用 sfntly 库(参见下面的“另请参阅”)(较旧?)Powerpoint 版本通过将嵌入字体转换为 .ttf 文件并将它们放入 Windows 字体目录来处理嵌入字体。如果不允许用户安装字体,则无法打开幻灯片。打开幻灯片时,可以从字体目录中复制提取的 .ttfs。当幻灯片关闭时,它们将被删除。)addFont
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 addFont
fontStream
- the EOT font as stream
(fontStream - EOT 字体作为流)
java.io.IOException
- if the fontData can't be saved or if the fontData is no EOT font
(java.io.IOException - 如果 fontData 无法保存或者 fontData 不是 EOT 字体)
public java.util.List<XSLFFontInfo> getFonts()
getFonts
in interface
SlideShow<XSLFShape,XSLFTextParagraph>
(界面 SlideShow 中的 getFonts
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.