|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hwpf.model.PicturesTable
public class PicturesTable
Holds information about all pictures embedded in Word Document either via "Insert -> Picture -> From File" or via clipboard. Responsible for images extraction and determining whether some document�s piece contains embedded image. Analyzes raw data bytestream �Data� (where Word stores all embedded objects) provided by HWPFDocument. Word stores images as is within so called "Data stream" - the stream within a Word docfile containing various data that hang off of characters in the main stream. For example, binary data describing in-line pictures and/or formfields an also embedded objects-native data. Word picture structures are concatenated one after the other in the data stream if the document contains pictures. Data stream is easily reachable via HWPFDocument._dataStream property. A picture is represented in the document text stream as a special character, an Unicode whose CharacterRun.isSpecial() returns true. The file location of the picture in the Word binary file is accessed via CharacterRun.getPicOffset(). The CharacterRun.getPicOffset() is a byte offset into the data stream. Beginning at the position recorded in picOffset, a header data structure, will be stored.
Constructor Summary | |
---|---|
PicturesTable(HWPFDocument _document,
byte[] _dataStream,
byte[] _mainStream,
FSPATable fspa,
EscherRecordHolder dgg)
|
Method Summary | |
---|---|
Picture |
extractPicture(CharacterRun run,
boolean fillBytes)
Returns picture object tied to specified CharacterRun |
java.util.List |
getAllPictures()
Not all documents have all the images concatenated in the data stream although MS claims so. |
boolean |
hasEscherPicture(CharacterRun run)
|
boolean |
hasHorizontalLine(CharacterRun run)
determines whether specified CharacterRun contains reference to a picture |
boolean |
hasPicture(CharacterRun run)
determines whether specified CharacterRun contains reference to a picture |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PicturesTable(HWPFDocument _document, byte[] _dataStream, byte[] _mainStream, FSPATable fspa, EscherRecordHolder dgg)
document
- _dataStream
- Method Detail |
---|
public boolean hasPicture(CharacterRun run)
run
- public boolean hasEscherPicture(CharacterRun run)
public boolean hasHorizontalLine(CharacterRun run)
run
- public Picture extractPicture(CharacterRun run, boolean fillBytes)
run
- fillBytes
- if true, Picture will be returned with filled byte array that represent picture's contents. If you don't want
to have that byte array in memory but only write picture's contents to stream, pass false and then use Picture.writeImageContent
Picture.writeImageContent(java.io.OutputStream)
,
hasPicture(org.apache.poi.hwpf.usermodel.CharacterRun)
public java.util.List getAllPictures()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |