@Override public void setFontAlignment(int align) { ParagraphAlignment pAlign = ParagraphAlignment.valueOf(align); setAlignment(pAlign); }
/** * @return The raw alignment value, {@link #getAlignment()} is suggested */ @Override public int getFontAlignment() { return getAlignment().getValue(); }
XWPFDocument document = new XWPFDocument(); XWPFParagraph tmpParagraph = document.createParagraph(); XWPFRun tmpRun = tmpParagraph.createRun(); tmpRun.setText("LALALALAALALAAAA"); tmpRun.setFontSize(18); document.write(new FileOutputStream(new File("yourpathhere"))); document.close();
public XWPFTable(CTTbl table, IBody part, int row, int col) { this(table, part); for (int i = 0; i < row; i++) { XWPFTableRow tabRow = (getRow(i) == null) ? createRow() : getRow(i); for (int k = 0; k < col; k++) { if (tabRow.getCell(k) == null) { tabRow.createCell(); } } } }
public Word07Writer() { this(new XWPFDocument()); }
/** * If this Hyperlink is an external reference hyperlink, * return the object for it. */ public XWPFHyperlink getHyperlink(XWPFDocument document) { String id = getHyperlinkId(); if (id == null) return null; return document.getHyperlinkByID(id); } }
public XWPFDocument(OPCPackage pkg) throws IOException { super(pkg); //build a tree of POIXMLDocumentParts, this document being the root load(XWPFFactory.getInstance()); }
/** * Create a new footnote and add it to the document. * * @return New XWPFFootnote. * @since 4.0.0 */ public XWPFFootnote createFootnote() { XWPFFootnotes footnotes = this.createFootnotes(); XWPFFootnote footnote = footnotes.createFootnote(); return footnote; }
/** * Get the width type for the table, as an {@link STTblWidth.Enum} value. * A table width can be specified as an absolute measurement (an integer * number of twips), a percentage, or the value "AUTO". * * @return The width type. * @since 4.0.0 */ public TableWidthType getWidthType() { return XWPFTable.getWidthType(getTcWidth()); }
/** * Set the width value type for the table. * <p>If the width type is changed from the current type and the currently-set value * is not consistent with the new width type, the value is reset to the default value * for the specified width type.</p> * * @param widthType Width type * @since 4.0.0 */ public void setWidthType(TableWidthType widthType) { XWPFTable.setWidthType(widthType, getTcWidth()); }
/** * Set the width to the value "auto", an integer value (20ths of a point), or a percentage ("nn.nn%"). * * @param widthValue String matching one of "auto", [0-9]+, or [0-9]+(\.[0-9]+)%. * @since 4.0.0 */ public void setWidth(String widthValue) { XWPFTable.setWidthValue(widthValue, getTcWidth()); }
/** * Create a new end note and add it to the document. * * @return New {@link XWPFEndnote}. * @since 4.0.0 */ public XWPFEndnote createEndnote() { XWPFEndnotes endnotes = this.createEndnotes(); XWPFEndnote endnote = endnotes.createEndnote(); return endnote; }
/** * Get the table width as a decimal value. * <p>If the width type is DXA or AUTO, then the value will always have * a fractional part of zero (because these values are really integers). * If the with type is percentage, then value may have a non-zero fractional * part. * * @return Width value as a double-precision decimal. * @since 4.0.0 */ public double getWidthDecimal() { return XWPFTable.getWidthDecimal(getTcWidth()); }
/** * @return document part */ public POIXMLDocumentPart getPart() { return part.getPart(); }
/** * Get the position of the table, within the list of * all the body elements. * * @param t The table to find * @return The location, or -1 if the table couldn't be found */ public int getPosOfTable(XWPFTable t) { return getPosOfBodyElement(t); }
/** * @see org.apache.poi.xwpf.usermodel.IBody#getPart() */ public XWPFDocument getXWPFDocument() { if (document != null) { return document; } else { return (XWPFDocument) getParent(); } }
/** * Enable or disable revision tracking. * * @param enable <code>true</code> to turn on revision tracking, <code>false</code> to turn off revision tracking */ public void setTrackRevisions(boolean enable) { settings.setTrackRevisions(enable); }
/** * Returns the mirror margins setting * * @return True or false indicating whether or not mirror margins is turned on. */ public boolean getMirrorMargins() { return settings.getMirrorMargins(); }
public Word07Writer() { this(new XWPFDocument()); }