Example usage for org.apache.poi.xwpf.usermodel XWPFPicture getCTPicture

List of usage examples for org.apache.poi.xwpf.usermodel XWPFPicture getCTPicture

Introduction

In this page you can find the example usage for org.apache.poi.xwpf.usermodel XWPFPicture getCTPicture.

Prototype

public CTPicture getCTPicture() 

Source Link

Document

Return the underlying CTPicture bean that holds all properties for this picture

Usage

From source file:org.obeonetwork.m2doc.generator.UserContentRawCopy.java

License:Open Source License

/**
 * createPictures in document./* www  . jav a  2s  .  c o m*/
 * 
 * @param inputRun
 *            input Run
 * @param outputDoc
 *            output Document
 * @throws InvalidFormatException
 *             InvalidFormatException
 */
private void createPictures(XWPFRun inputRun, XWPFDocument outputDoc) throws InvalidFormatException {
    // Add picture in document and keep relation id change idRelation reference
    for (XWPFPicture inputPic : inputRun.getEmbeddedPictures()) {
        byte[] img = inputPic.getPictureData().getData();
        // Put image in doc and get idRelation
        String idRelationOutput = outputDoc.addPictureData(img, inputPic.getPictureData().getPictureType());
        String idRelationInput = inputPic.getCTPicture().getBlipFill().getBlip().getEmbed();
        inputPicuteIdToOutputmap.put(idRelationInput, idRelationOutput);
    }
}