Search in sources :

Example 1 with AbstractEscherHolderRecord

use of org.apache.poi.hssf.record.AbstractEscherHolderRecord in project poi by apache.

the class HSSFWorkbook method getAllPictures.

/**
     * Gets all pictures from the Workbook.
     *
     * @return the list of pictures (a list of {@link HSSFPictureData} objects.)
     */
@Override
public List<HSSFPictureData> getAllPictures() {
    // The drawing group record always exists at the top level, so we won't need to do this recursively.
    List<HSSFPictureData> pictures = new ArrayList<HSSFPictureData>();
    for (Record r : workbook.getRecords()) {
        if (r instanceof AbstractEscherHolderRecord) {
            ((AbstractEscherHolderRecord) r).decode();
            List<EscherRecord> escherRecords = ((AbstractEscherHolderRecord) r).getEscherRecords();
            searchForPictures(escherRecords, pictures);
        }
    }
    return Collections.unmodifiableList(pictures);
}
Also used : AbstractEscherHolderRecord(org.apache.poi.hssf.record.AbstractEscherHolderRecord) ArrayList(java.util.ArrayList) UnknownRecord(org.apache.poi.hssf.record.UnknownRecord) RecalcIdRecord(org.apache.poi.hssf.record.RecalcIdRecord) EscherBSERecord(org.apache.poi.ddf.EscherBSERecord) Record(org.apache.poi.hssf.record.Record) AbstractEscherHolderRecord(org.apache.poi.hssf.record.AbstractEscherHolderRecord) BoundSheetRecord(org.apache.poi.hssf.record.BoundSheetRecord) EscherBlipRecord(org.apache.poi.ddf.EscherBlipRecord) DrawingGroupRecord(org.apache.poi.hssf.record.DrawingGroupRecord) BackupRecord(org.apache.poi.hssf.record.BackupRecord) EscherRecord(org.apache.poi.ddf.EscherRecord) NameRecord(org.apache.poi.hssf.record.NameRecord) LabelSSTRecord(org.apache.poi.hssf.record.LabelSSTRecord) LabelRecord(org.apache.poi.hssf.record.LabelRecord) FilePassRecord(org.apache.poi.hssf.record.FilePassRecord) FontRecord(org.apache.poi.hssf.record.FontRecord) SSTRecord(org.apache.poi.hssf.record.SSTRecord) ExtendedFormatRecord(org.apache.poi.hssf.record.ExtendedFormatRecord) EscherRecord(org.apache.poi.ddf.EscherRecord)

Aggregations

ArrayList (java.util.ArrayList)1 EscherBSERecord (org.apache.poi.ddf.EscherBSERecord)1 EscherBlipRecord (org.apache.poi.ddf.EscherBlipRecord)1 EscherRecord (org.apache.poi.ddf.EscherRecord)1 AbstractEscherHolderRecord (org.apache.poi.hssf.record.AbstractEscherHolderRecord)1 BackupRecord (org.apache.poi.hssf.record.BackupRecord)1 BoundSheetRecord (org.apache.poi.hssf.record.BoundSheetRecord)1 DrawingGroupRecord (org.apache.poi.hssf.record.DrawingGroupRecord)1 ExtendedFormatRecord (org.apache.poi.hssf.record.ExtendedFormatRecord)1 FilePassRecord (org.apache.poi.hssf.record.FilePassRecord)1 FontRecord (org.apache.poi.hssf.record.FontRecord)1 LabelRecord (org.apache.poi.hssf.record.LabelRecord)1 LabelSSTRecord (org.apache.poi.hssf.record.LabelSSTRecord)1 NameRecord (org.apache.poi.hssf.record.NameRecord)1 RecalcIdRecord (org.apache.poi.hssf.record.RecalcIdRecord)1 Record (org.apache.poi.hssf.record.Record)1 SSTRecord (org.apache.poi.hssf.record.SSTRecord)1 UnknownRecord (org.apache.poi.hssf.record.UnknownRecord)1