/** * Adds a <CODE>Phrase</CODE> to the current text array. * Will not have any effect if addElement() was called before. * @param phrase the text * @since 2.1.5 */ public void addText(Phrase phrase) { columnText.addText(phrase); }
/** * Adds a <CODE>Chunk</CODE> to the current text array. * Will not have any effect if addElement() was called before. * @param chunk the text * @since 2.1.5 */ public void addText(Chunk chunk) { columnText.addText(chunk); }
/** * Adds a <CODE>Chunk</CODE> to the current text array. * Will not have any effect if addElement() was called before. * @param chunk the text * @since 2.1.5 */ public void addText(Chunk chunk) { columnText.addText(chunk); }
/** * Adds a <CODE>Chunk</CODE> to the current text array. * Will not have any effect if addElement() was called before. * @param chunk the text * @since 2.1.5 */ public void addText(Chunk chunk) { columnText.addText(chunk); }
/** * Adds a <CODE>Phrase</CODE> to the current text array. * Will not have any effect if addElement() was called before. * @param phrase the text * @since 2.1.5 */ public void addText(Phrase phrase) { columnText.addText(phrase); }
/** * Adds a <CODE>Phrase</CODE> to the current text array. * Will not have any effect if addElement() was called before. * @param phrase the text * @since 2.1.5 */ public void addText(Phrase phrase) { columnText.addText(phrase); }
/** * Constructs a <CODE>PdfPCell</CODE> with a <CODE>Phrase</CODE>. * The default padding is 2. * * @param phrase the text */ public PdfPCell(Phrase phrase) { super(0, 0, 0, 0); borderWidth = 0.5f; border = BOX; column.addText(this.phrase = phrase); column.setLeading(0, 1); }
/** * Constructs a <CODE>PdfPCell</CODE> with a <CODE>Phrase</CODE>. * The default padding is 2. * * @param phrase the text */ public PdfPCell(Phrase phrase) { super(0, 0, 0, 0); borderWidth = 0.5f; border = BOX; column.addText(this.phrase = phrase); column.setLeading(0, 1); }
/** * Adds a <CODE>Chunk</CODE> to the current text array. * Will not have any effect if addElement() was called before. * * @param chunk the text */ public void addText(Chunk chunk) { if (chunk == null || composite) return; addText(new Phrase(chunk)); }
/** * Adds a <CODE>Chunk</CODE> to the current text array. * Will not have any effect if addElement() was called before. * * @param chunk the text */ public void addText(Chunk chunk) { if (chunk == null || composite) return; addText(new Phrase(chunk)); }
/** * Adds a <CODE>Chunk</CODE> to the current text array. * Will not have any effect if addElement() was called before. * * @param chunk the text */ public void addText(Chunk chunk) { if (chunk == null || composite) return; addText(new Phrase(chunk)); }
/** * Constructs a <CODE>PdfPCell</CODE> with a <CODE>Phrase</CODE>. * The default padding is 2. * * @param phrase the text */ public PdfPCell(Phrase phrase) { super(0, 0, 0, 0); borderWidth = 0.5f; border = BOX; column.addText(this.phrase = phrase); column.setLeading(0, 1); }
/** * Simplified method for rectangular columns. * * @param phrase a <CODE>Phrase</CODE> * @param llx the lower left x corner * @param lly the lower left y corner * @param urx the upper right x corner * @param ury the upper right y corner * @param leading the leading * @param alignment the column alignment */ public void setSimpleColumn(Phrase phrase, float llx, float lly, float urx, float ury, float leading, int alignment) { addText(phrase); setSimpleColumn(llx, lly, urx, ury, leading, alignment); }
/** * Simplified method for rectangular columns. * * @param phrase a <CODE>Phrase</CODE> * @param llx the lower left x corner * @param lly the lower left y corner * @param urx the upper right x corner * @param ury the upper right y corner * @param leading the leading * @param alignment the column alignment */ public void setSimpleColumn(Phrase phrase, float llx, float lly, float urx, float ury, float leading, int alignment) { addText(phrase); setSimpleColumn(llx, lly, urx, ury, leading, alignment); }
/** * Simplified method for rectangular columns. * * @param phrase a <CODE>Phrase</CODE> * @param llx the lower left x corner * @param lly the lower left y corner * @param urx the upper right x corner * @param ury the upper right y corner * @param leading the leading * @param alignment the column alignment */ public void setSimpleColumn(Phrase phrase, float llx, float lly, float urx, float ury, float leading, int alignment) { addText(phrase); setSimpleColumn(llx, lly, urx, ury, leading, alignment); }
/** * Add an element to be rendered in a column. * Note that you can only add a <CODE>Phrase</CODE> * or a <CODE>Chunk</CODE> if the columns are * not all simple. This is an underlying restriction in * {@link com.lowagie.text.pdf.ColumnText} * * @param element element to add * @throws DocumentException if element can't be added */ public void addElement(Element element) throws DocumentException { if (simple) { columnText.addElement(element); } else if (element instanceof Phrase) { columnText.addText((Phrase) element); } else if (element instanceof Chunk) { columnText.addText((Chunk) element); } else { throw new DocumentException("Can't add " + element.getClass() + " to MultiColumnText with complex columns"); } }
/** * Gets the width that the line will occupy after writing. * Only the width of the first line is returned. * * @param phrase the <CODE>Phrase</CODE> containing the line * @param runDirection the run direction * @param arabicOptions the options for the arabic shaping * @return the width of the line */ public static float getWidth(Phrase phrase, int runDirection, int arabicOptions) { ColumnText ct = new ColumnText(null); ct.addText(phrase); ct.addWaitingPhrase(); PdfLine line = ct.bidiLine.processLine(0, 20000, Element.ALIGN_LEFT, runDirection, arabicOptions); if (line == null) return 0; else return 20000 - line.widthLeft(); }
/** * Gets the width that the line will occupy after writing. * Only the width of the first line is returned. * * @param phrase the <CODE>Phrase</CODE> containing the line * @param runDirection the run direction * @param arabicOptions the options for the arabic shaping * @return the width of the line */ public static float getWidth(Phrase phrase, int runDirection, int arabicOptions) { ColumnText ct = new ColumnText(null); ct.addText(phrase); ct.addWaitingPhrase(); PdfLine line = ct.bidiLine.processLine(0, 20000, Element.ALIGN_LEFT, runDirection, arabicOptions); if (line == null) return 0; else return 20000 - line.widthLeft(); }
/** * Gets the width that the line will occupy after writing. * Only the width of the first line is returned. * * @param phrase the <CODE>Phrase</CODE> containing the line * @param runDirection the run direction * @param arabicOptions the options for the arabic shaping * @return the width of the line */ public static float getWidth(Phrase phrase, int runDirection, int arabicOptions) { ColumnText ct = new ColumnText(null); ct.addText(phrase); ct.addWaitingPhrase(); PdfLine line = ct.bidiLine.processLine(0, 20000, Element.ALIGN_LEFT, runDirection, arabicOptions); if (line == null) return 0; else return 20000 - line.widthLeft(); }
/** * Constructs a <CODE>PdfPCell</CODE> with an <CODE>Image</CODE>. * The default padding is 0.25 for a border width of 0.5. * * @param image the <CODE>Image</CODE> * @param fit <CODE>true</CODE> to fit the image to the cell */ public PdfPCell(Image image, boolean fit) { super(0, 0, 0, 0); borderWidth = 0.5f; border = BOX; if (fit) { this.image = image; column.setLeading(0, 1); setPadding(borderWidth / 2); } else { column.addText(this.phrase = new Phrase(new Chunk(image, 0, 0))); column.setLeading(0, 1); setPadding(0); } }