List of usage examples for org.apache.poi.xwpf.usermodel XWPFParagraph setAlignment
public void setAlignment(ParagraphAlignment align)
From source file:Utils.FileHandler.java
private void fullWidthPicture(XWPFDocument doc, File imgFile) throws InvalidFormatException, IOException { XWPFParagraph p2 = doc.createParagraph(); p2.setAlignment(ParagraphAlignment.LEFT); XWPFRun imageRun = p2.createRun();/*from w w w . j a v a2 s .co m*/ imageRun.setTextPosition(10); imageRun.setText(" "); imageRun.setFontSize(1); imageRun.addPicture(new FileInputStream(imgFile), XWPFDocument.PICTURE_TYPE_PNG, "image", Units.toEMU(469), Units.toEMU(274)); p2.setBorderBottom(Borders.SINGLE); p2.setBorderTop(Borders.SINGLE); p2.setBorderRight(Borders.SINGLE); p2.setBorderLeft(Borders.SINGLE); }