public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFShape,HSLFTextParagraph>, java.io.Closeable, GenericRecord
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POWERPOINT_DOCUMENT
Powerpoint document entry/stream name
(Powerpoint 文档条目/流名称)
|
static java.lang.String |
PP95_DOCUMENT |
static java.lang.String |
PP97_DOCUMENT |
Constructor and Description |
---|
HSLFSlideShow()
Constructs a new, empty, Powerpoint document.
|
HSLFSlideShow(DirectoryNode root)
Constructs a Powerpoint document from an DirectoryNode.
|
HSLFSlideShow(HSLFSlideShowImpl hslfSlideShow)
Constructs a Powerpoint document from the underlying HSLFSlideShow object.
|
HSLFSlideShow(java.io.InputStream inputStream)
Constructs a Powerpoint document from an input stream.
|
HSLFSlideShow(POIFSFileSystem poifs)
Constructs a Powerpoint document from an POIFSFileSystem.
|
Modifier and Type | Method and Description |
---|---|
int |
addControl(java.lang.String name, java.lang.String progId)
Add a control in this presentation
(在此演示文稿中添加控件)
|
int |
addEmbed(POIFSFileSystem poiData)
Add a embedded object to this presentation
(向此演示文稿添加嵌入对象)
|
HSLFFontInfo |
addFont(FontInfo fontInfo)
Add a font in this presentation
(在此演示文稿中添加字体)
|
HSLFFontInfo |
addFont(java.io.InputStream fontData)
Add a font in this presentation and also embed its font data
(在此演示文稿中添加字体并嵌入其字体数据)
|
int |
addMovie(java.lang.String path, int type)
Add a movie in this presentation
(在此演示文稿中添加电影)
|
HSLFPictureData |
addPicture(byte[] data, PictureData.PictureType format)
Adds a picture to the presentation.
(在演示文稿中添加图片。)
|
HSLFPictureData |
addPicture(java.io.File pict, PictureData.PictureType format)
Adds a picture to the presentation.
(在演示文稿中添加图片。)
|
HSLFPictureData |
addPicture(java.io.InputStream is, PictureData.PictureType format)
Adds a picture to the presentation.
(在演示文稿中添加图片。)
|
protected void |
clearDirectory()
Clear/unlink the attached directory entry
(清除/取消链接附加的目录条目)
|
void |
close()
Closes the underlying
POIFSFileSystem from which the document was read, if any.
(关闭从中读取文档的基础 POIFSFileSystem(如果有)。)
|
void |
createInformationProperties()
Will create whichever of SummaryInformation and DocumentSummaryInformation (HPSF) properties are not already part of your document.
(将创建尚未包含在文档中的 SummaryInformation 和 DocumentSummaryInformation (HPSF) 属性。)
|
MasterSheet<HSLFShape,HSLFTextParagraph> |
createMasterSheet() |
HSLFSlide |
createSlide()
Create a blank
Slide .
(创建一个空白幻灯片。)
|
HSLFPictureData |
findPictureData(byte[] pictureData)
check if a picture with this picture data already exists in this presentation
(检查此演示文稿中是否已存在具有此图片数据的图片)
|
Record |
getCoreRecordForRefID(int refID)
For a given refID (the internal, 0 based numbering scheme), return the core record
(对于给定的 refID(基于 0 的内部编号方案),返回核心记录)
|
Record |
getCoreRecordForSAS(SlideListWithText.SlideAtomsSet sas)
For a given SlideAtomsSet, return the core record, based on the refID from the SlidePersistAtom
(对于给定的 SlideAtomsSet,根据 SlidePersistAtom 的 refID 返回核心记录)
|
DirectoryNode |
getDirectory() |
Document |
getDocumentRecord()
Helper method for usermodel and model: Get the document record
(usermodel 和 model 的 Helper 方法:获取文档记录)
|
DocumentSummaryInformation |
getDocumentSummaryInformation()
Fetch the Document Summary Information of the document
(获取文档的文档摘要信息)
|
HSLFObjectData[] |
getEmbeddedObjects()
Returns the data of all the embedded OLE object in the SlideShow
(返回幻灯片中所有嵌入的 OLE 对象的数据)
|
protected java.lang.String |
getEncryptedPropertyStreamName() |
EncryptionInfo |
getEncryptionInfo() |
HSLFFontInfo |
getFont(int idx)
Get a font by index
(通过索引获取字体)
|
java.util.List<HSLFFontInfo> |
getFonts() |
java.util.List<? extends GenericRecord> |
getGenericChildren() |
java.util.Map<java.lang.String,java.util.function.Supplier<?>> |
getGenericProperties() |
HPSFPropertiesExtractor |
getMetadataTextExtractor() |
Record[] |
getMostRecentCoreRecords()
Returns an array of the most recent version of all the interesting records
(返回所有感兴趣记录的最新版本的数组)
|
java.util.List<HSLFNotes> |
getNotes()
Returns an array of all the normal Notes found in the slideshow
(返回幻灯片中所有正常笔记的数组)
|
HeadersFooters |
getNotesHeadersFooters()
Return Header / Footer settings for notes
(返回注释的页眉/页脚设置)
|
int |
getNumberOfFonts()
get the number of fonts in the presentation
(获取演示文稿中的字体数量)
|
java.awt.Dimension |
getPageSize()
Returns the current page size
(返回当前页面大小)
|
java.lang.Object |
getPersistDocument() |
java.util.List<HSLFPictureData> |
getPictureData()
Returns all Pictures of this slideshow.
(返回此幻灯片的所有图片。)
|
protected PropertySet |
getPropertySet(java.lang.String setName)
For a given named property entry, either return it or null if if it wasn't found
(对于给定的命名属性条目,如果未找到,则返回它或 null)
|
protected PropertySet |
getPropertySet(java.lang.String setName, EncryptionInfo encryptionInfo)
For a given named property entry, either return it or null if if it wasn't found
(对于给定的命名属性条目,如果未找到,则返回它或 null)
|
HeadersFooters |
getSlideHeadersFooters()
Return Header / Footer settings for slides
(返回幻灯片的页眉/页脚设置)
|
java.util.List<HSLFSlideMaster> |
getSlideMasters()
Returns an array of all the normal Slide Masters found in the slideshow
(返回幻灯片中找到的所有普通幻灯片母版的数组)
|
java.util.List<HSLFSlide> |
getSlides()
Returns an array of all the normal Slides found in the slideshow
(返回在幻灯片中找到的所有正常幻灯片的数组)
|
HSLFSlideShowImpl |
getSlideShowImpl() |
HSLFSoundData[] |
getSoundData()
Returns the data of all the embedded sounds in the SlideShow
(返回幻灯片中所有嵌入声音的数据)
|
SummaryInformation |
getSummaryInformation()
Fetch the Summary Information of the document
(获取文档的摘要信息)
|
java.util.List<HSLFTitleMaster> |
getTitleMasters()
Returns an array of all the normal Title Masters found in the slideshow
(返回幻灯片中所有正常标题母版的数组)
|
protected boolean |
initDirectory()
check if we were created by POIFS otherwise create a new dummy POIFS for storing the package data
(检查我们是否由 POIFS 创建,否则创建一个新的虚拟 POIFS 用于存储包数据)
|
void |
readProperties()
Find, and create objects for, the standard Document Information Properties (HPSF).
(查找标准文档信息属性 (HPSF) 并为其创建对象。)
|
HSLFSlide |
removeSlide(int index)
Removes the slide at the given index (0-based).
(删除给定索引处的幻灯片(从 0 开始)。)
|
void |
reorderSlide(int oldSlideNumber, int newSlideNumber)
Re-orders a slide, to a new position.
(将幻灯片重新排序到新位置。)
|
protected void |
replaceDirectory(DirectoryNode newDirectory)
Replaces the attached directory, e.g.
(替换附加目录,例如)
|
void |
setPageSize(java.awt.Dimension pgsize)
Change the current page size
(更改当前页面大小)
|
protected void |
validateInPlaceWritePossible()
Called during a
POIDocument.write() to ensure that the Document (and associated
POIFSFileSystem ) was opened in a way compatible with an in-place write.
(在 POIDocument.write() 期间调用,以确保以与就地写入兼容的方式打开文档(和相关的 POIFSFileSystem)。)
|
void |
write()
Writes the document out to the currently open
File , via the writeable
POIFSFileSystem it was opened from.
(通过打开它的可写 POIFSFileSystem 将文档写入当前打开的文件。)
|
void |
write(java.io.File newFile)
Writes the document out to the specified new
File .
(将文档写入指定的新文件。)
|
void |
write(java.io.OutputStream out)
Writes the document out to the specified output stream.
(将文档写入指定的输出流。)
|
protected void |
writeProperties()
Writes out the updated standard Document Information Properties (HPSF) into the currently open POIFSFileSystem
(将更新的标准文档信息属性 (HPSF) 写入当前打开的 POIFSFileSystem)
|
void |
writeProperties(POIFSFileSystem outFS)
Writes out the standard Document Information Properties (HPSF)
(写出标准文档信息属性 (HPSF))
|
protected void |
writeProperties(POIFSFileSystem outFS, java.util.List<java.lang.String> writtenEntries)
Writes out the standard Document Information Properties (HPSF)
(写出标准文档信息属性 (HPSF))
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGenericRecordType
public static final java.lang.String POWERPOINT_DOCUMENT
public static final java.lang.String PP97_DOCUMENT
public static final java.lang.String PP95_DOCUMENT
public HSLFSlideShow(HSLFSlideShowImpl hslfSlideShow)
hslfSlideShow
- the HSLFSlideShow to base on
(hslfSlideShow - 基于的 HSLFSlideShow)
public HSLFSlideShow()
public HSLFSlideShow(java.io.InputStream inputStream) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public HSLFSlideShow(POIFSFileSystem poifs) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public HSLFSlideShow(DirectoryNode root) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public Record getCoreRecordForSAS(SlideListWithText.SlideAtomsSet sas)
public Record getCoreRecordForRefID(int refID)
refID
- the refID
(refID - refID)
public void write(java.io.OutputStream out) throws java.io.IOException
POIDocument
File
rather than an
InputStream
, you
must write out using
POIDocument.write()
or to a different File. Overwriting the currently open file via an OutputStream isn't possible. If
stream
is a
FileOutputStream
on a networked drive or has a high cost/latency associated with each written byte, consider wrapping the OutputStream in a
BufferedOutputStream
to improve write performance, or use
POIDocument.write()
/
POIDocument.write(File)
if possible.
(将文档写入指定的输出流。作为此操作的一部分,流不会关闭。注意 - 如果文档是从文件而不是 InputStream 打开的,则必须使用 POIDocument.write() 或写入不同的文件。无法通过 OutputStream 覆盖当前打开的文件。如果流是网络驱动器上的 FileOutputStream 或与每个写入字节相关的成本/延迟较高,请考虑将 OutputStream 包装在 BufferedOutputStream 中以提高写入性能,或尽可能使用 POIDocument.write() / POIDocument.write(File) .)
write
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(写在界面SlideShow
write
in class
POIDocument
(写在类 POIDocument)
out
- The stream to write to.
(out - 要写入的流。)
java.io.IOException
- thrown on errors writing to the stream
(java.io.IOException - 写入流时抛出错误)
public Record[] getMostRecentCoreRecords()
public java.util.List<HSLFSlide> getSlides()
getSlides
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 getSlides
public java.util.List<HSLFNotes> getNotes()
public java.util.List<HSLFSlideMaster> getSlideMasters()
getSlideMasters
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 getSlideMasters
public java.util.List<HSLFTitleMaster> getTitleMasters()
public java.util.List<HSLFPictureData> getPictureData()
SlideShow
List
is unmodifiable.
(返回此幻灯片的所有图片。返回的 List 是不可修改的。)
getPictureData
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(接口 SlideShow 中的 getPictureData
List
of
PictureData
.
(图片数据列表。)
public HSLFObjectData[] getEmbeddedObjects()
public HSLFSoundData[] getSoundData()
public java.awt.Dimension getPageSize()
SlideShow
getPageSize
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 getPageSize
public void setPageSize(java.awt.Dimension pgsize)
SlideShow
setPageSize
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 setPageSize
pgsize
- page size (in points)
(pgsize - 页面大小(以磅为单位))
public Document getDocumentRecord()
public void reorderSlide(int oldSlideNumber, int newSlideNumber)
oldSlideNumber
- The old slide number (1 based)
(oldSlideNumber - 旧幻灯片编号(基于 1))
newSlideNumber
- The new slide number (1 based)
(newSlideNumber - 新幻灯片编号(基于 1))
public HSLFSlide removeSlide(int index)
Shifts any subsequent slides to the left (subtracts one from their slide numbers).
(删除给定索引处的幻灯片(从 0 开始)。将任何后续幻灯片向左移动(从幻灯片编号中减去一张)。)index
- the index of the slide to remove (0-based)
(index - 要删除的幻灯片的索引(从 0 开始))
public HSLFSlide createSlide()
Slide
.
(创建一个空白幻灯片。)
createSlide
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 createSlide
Slide
(创建的幻灯片)
public HSLFPictureData addPicture(byte[] data, PictureData.PictureType format) throws java.io.IOException
SlideShow
addPicture
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(在界面幻灯片中添加图片
data
- The bytes of the picture
(data - 图片的字节数)
format
- The format of the picture.
(format - 图片的格式。)
java.io.IOException
(java.io.IOException)
public HSLFPictureData addPicture(java.io.InputStream is, PictureData.PictureType format) throws java.io.IOException
addPicture
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(在界面幻灯片中添加图片
is
- The stream to read the image from
(is - 从中读取图像的流)
format
- The format of the picture.
(format - 图片的格式。)
java.io.IOException
(java.io.IOException)
public HSLFPictureData addPicture(java.io.File pict, PictureData.PictureType format) throws java.io.IOException
addPicture
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(在界面幻灯片中添加图片
pict
- the file containing the image to add
(pict - 包含要添加的图像的文件)
format
- The format of the picture.
(format - 图片的格式。)
java.io.IOException
(java.io.IOException)
public HSLFPictureData findPictureData(byte[] pictureData)
findPictureData
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(在界面 SlideShow 中查找图片数据
pictureData
- The picture data to find in the SlideShow
(pictureData - 要在幻灯片中查找的图片数据)
null
if picture data is not found in this slideshow
(如果在此幻灯片中未找到图片数据,则为 null)
public HSLFFontInfo addFont(FontInfo fontInfo)
fontInfo
- the font to add
(fontInfo - 要添加的字体)
public HSLFFontInfo addFont(java.io.InputStream fontData) throws java.io.IOException
addFont
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 addFont
fontData
- the EOT font data as stream
(fontData - 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 HSLFFontInfo getFont(int idx)
idx
- 0-based index of the font
(idx - 从 0 开始的字体索引)
PPFont
or
null
if not found
(PPFont 实例的名称,如果未找到,则为 null)
public int getNumberOfFonts()
public java.util.List<HSLFFontInfo> getFonts()
getFonts
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 getFonts
public HeadersFooters getSlideHeadersFooters()
public HeadersFooters getNotesHeadersFooters()
public int addMovie(java.lang.String path, int type)
path
- the path or url to the movie
(path - 电影的路径或 url)
public int addControl(java.lang.String name, java.lang.String progId)
name
- name of the control, e.g. "Shockwave Flash Object"
(name - 控件的名称,例如“Shockwave Flash Object”)
progId
- OLE Programmatic Identifier, e.g. "ShockwaveFlash.ShockwaveFlash.9"
(progId - OLE 程序标识符,例如“ShockwaveFlash.ShockwaveFlash.9”)
public int addEmbed(POIFSFileSystem poiData)
public HPSFPropertiesExtractor getMetadataTextExtractor()
getMetadataTextExtractor
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(接口 SlideShow 中的 getMetadataTextExtractor
public MasterSheet<HSLFShape,HSLFTextParagraph> createMasterSheet()
createMasterSheet
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 createMasterSheet
@Internal public HSLFSlideShowImpl getSlideShowImpl()
public void close() throws java.io.IOException
POIDocument
POIFSFileSystem
from which the document was read, if any. Has no effect on documents opened from an InputStream, or newly created ones.
Once close()
has been called, no further operations should be called on the document.
close
in interface
java.io.Closeable
(在接口 java.io.Closeable 中关闭)
close
in interface
java.lang.AutoCloseable
(在接口 java.lang.AutoCloseable 中关闭)
close
in class
POIDocument
java.io.IOException
(java.io.IOException)
public java.lang.Object getPersistDocument()
getPersistDocument
in interface
SlideShow<HSLFShape,HSLFTextParagraph>
(界面 SlideShow 中的 getPersistDocument
POIDocument
or
POIXMLDocument
(处理幻灯片持久化的实例,它是 POIDocument 或 POIXMLDocument 的子类)
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
getGenericProperties
in interface
GenericRecord
(接口 GenericRecord 中的 getGenericProperties)
public java.util.List<? extends GenericRecord> getGenericChildren()
getGenericChildren
in interface
GenericRecord
(接口 GenericRecord 中的 getGenericChildren)
public void write() throws java.io.IOException
POIDocument
File
, via the writeable
POIFSFileSystem
it was opened from.
This will fail (with an IllegalStateException
if the document was opened read-only, opened from an InputStream
instead of a File, or if this is not the root document. For those cases, you must use POIDocument.write(OutputStream)
or POIDocument.write(File)
to write to a brand new document.
write
in class
POIDocument
(写在类 POIDocument)
java.io.IOException
- thrown on errors writing to the file
(java.io.IOException - 写入文件出错时抛出)
public void write(java.io.File newFile) throws java.io.IOException
POIDocument
File
. If the file exists, it will be replaced, otherwise a new one will be created
(将文档写入指定的新文件。如果文件存在,则将其替换,否则将创建一个新文件)
write
in class
POIDocument
(写在类 POIDocument)
newFile
- The new File to write to.
(newFile - 要写入的新文件。)
java.io.IOException
- thrown on errors writing to the file
(java.io.IOException - 写入文件出错时抛出)
public DocumentSummaryInformation getDocumentSummaryInformation()
POIDocument
getDocumentSummaryInformation
in class
POIDocument
public SummaryInformation getSummaryInformation()
POIDocument
getSummaryInformation
in class
POIDocument
public void createInformationProperties()
POIDocument
createInformationProperties
in class
POIDocument
public void readProperties()
POIDocument
readProperties
in class
POIDocument
protected PropertySet getPropertySet(java.lang.String setName) throws java.io.IOException
POIDocument
getPropertySet
in class
POIDocument
setName
- The property to read
(setName - 要读取的属性)
java.io.IOException
- If retrieving properties fails
(java.io.IOException - 如果检索属性失败)
protected PropertySet getPropertySet(java.lang.String setName, EncryptionInfo encryptionInfo) throws java.io.IOException
POIDocument
getPropertySet
in class
POIDocument
setName
- The property to read
(setName - 要读取的属性)
encryptionInfo
- the encryption descriptor in case of cryptoAPI encryption
(encryptionInfo - cryptoAPI 加密情况下的加密描述符)
java.io.IOException
- If retrieving properties fails
(java.io.IOException - 如果检索属性失败)
protected void writeProperties() throws java.io.IOException
POIDocument
writeProperties
in class
POIDocument
java.io.IOException
- if an error when writing to the open
POIFSFileSystem
occurs
(java.io.IOException - 如果写入打开的 POIFSFileSystem 时发生错误)
public void writeProperties(POIFSFileSystem outFS) throws java.io.IOException
POIDocument
writeProperties
in class
POIDocument
outFS
- the POIFSFileSystem to write the properties into
(outFS - 将属性写入的 POIFSFileSystem)
java.io.IOException
- if an error when writing to the
POIFSFileSystem
occurs
(java.io.IOException - 如果写入 POIFSFileSystem 时发生错误)
protected void writeProperties(POIFSFileSystem outFS, java.util.List<java.lang.String> writtenEntries) throws java.io.IOException
POIDocument
writeProperties
in class
POIDocument
outFS
- the
POIFSFileSystem
to write the properties into
(outFS - 将属性写入的 POIFSFileSystem)
writtenEntries
- a list of POIFS entries to add the property names too
(writtenEntries - 一个 POIFS 条目列表,也可以添加属性名称)
java.io.IOException
- if an error when writing to the
POIFSFileSystem
occurs
(java.io.IOException - 如果写入 POIFSFileSystem 时发生错误)
protected void validateInPlaceWritePossible() throws java.lang.IllegalStateException
POIDocument
POIDocument.write()
to ensure that the Document (and associated
POIFSFileSystem
) was opened in a way compatible with an in-place write.
(在 POIDocument.write() 期间调用,以确保以与就地写入兼容的方式打开文档(和相关的 POIFSFileSystem)。)
validateInPlaceWritePossible
in class
POIDocument
java.lang.IllegalStateException
- if the document was opened suitably
(java.lang.IllegalStateException - 如果文档打开得当)
public DirectoryNode getDirectory()
getDirectory
in class
POIDocument
protected void clearDirectory()
POIDocument
clearDirectory
in class
POIDocument
protected boolean initDirectory()
POIDocument
initDirectory
in class
POIDocument
true
if dummy directory was created,
false
otherwise
(如果创建了虚拟目录,则为 true,否则为 false)
protected void replaceDirectory(DirectoryNode newDirectory) throws java.io.IOException
POIDocument
replaceDirectory
in class
POIDocument
newDirectory
- the new directory
(newDirectory - 新目录)
java.io.IOException
(java.io.IOException)
protected java.lang.String getEncryptedPropertyStreamName()
getEncryptedPropertyStreamName
in class
POIDocument
public EncryptionInfo getEncryptionInfo() throws java.io.IOException
getEncryptionInfo
in class
POIDocument
null
(如果文档已加密,则为加密信息,否则为 null)
java.io.IOException
- If retrieving the encryption information fails
(java.io.IOException - 如果检索加密信息失败)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.