/** * Returns the content of this <CODE>Chunk</CODE>. * * @return a <CODE>String</CODE> */ @Override public String toString() { return getContent(); }
/** * Returns the content of this <CODE>Chunk</CODE>. * * @return a <CODE>String</CODE> */ @Override public String toString() { return getContent(); }
private static Element discardNewline(Element sub) { if (sub instanceof Chunk) { Chunk c = (Chunk) sub; String content = c.getContent(); if (content.endsWith("\n") && content.length() < 2) { return new Chunk(" "); } } return sub; }
@Override public String getContent() { return pageNumberChunk ? String.valueOf( ownerDocument.getPageNumber() ) : super.getContent(); } }
/** * Constructs a <CODE>PdfOutline</CODE>. * <P> * This is the constructor for an <CODE>outline entry</CODE>. * * @param parent the parent of this outline item * @param action the <CODE>PdfAction</CODE> for this outline item * @param title the title of this outline item * @param open <CODE>true</CODE> if the children are visible */ public PdfOutline(PdfOutline parent, PdfAction action, Paragraph title, boolean open) { super(); StringBuffer buf = new StringBuffer(); for (Chunk chunk: title.getChunks()) { buf.append(chunk.getContent()); } this.action = action; initOutline(parent, buf.toString(), open); }
/** * Constructs a <CODE>PdfOutline</CODE>. * <P> * This is the constructor for an <CODE>outline entry</CODE>. * * @param parent the parent of this outline item * @param destination the destination for this outline item * @param title the title of this outline item * @param open <CODE>true</CODE> if the children are visible */ public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title, boolean open) { super(); StringBuffer buf = new StringBuffer(); for (Object element : title.getChunks()) { Chunk chunk = (Chunk) element; buf.append(chunk.getContent()); } this.destination = destination; initOutline(parent, buf.toString(), open); }
/** * Constructs a <CODE>PdfOutline</CODE>. * <P> * This is the constructor for an <CODE>outline entry</CODE>. * * @param parent the parent of this outline item * @param action the <CODE>PdfAction</CODE> for this outline item * @param title the title of this outline item * @param open <CODE>true</CODE> if the children are visible */ public PdfOutline(PdfOutline parent, PdfAction action, Paragraph title, boolean open) { super(); StringBuffer buf = new StringBuffer(); for (Chunk chunk: title.getChunks()) { buf.append(chunk.getContent()); } this.action = action; initOutline(parent, buf.toString(), open); }
/** * Constructs a <CODE>PdfOutline</CODE>. * <P> * This is the constructor for an <CODE>outline entry</CODE>. * * @param parent the parent of this outline item * @param destination the destination for this outline item * @param title the title of this outline item * @param open <CODE>true</CODE> if the children are visible */ public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title, boolean open) { super(); StringBuffer buf = new StringBuffer(); for (Object element : title.getChunks()) { Chunk chunk = (Chunk) element; buf.append(chunk.getContent()); } this.destination = destination; initOutline(parent, buf.toString(), open); }
value = chunk.getContent(); attributes.put(Chunk.GENERICTAG, chunk.getContent());
value = chunk.getContent(); attributes.put(Chunk.GENERICTAG, chunk.getContent());
/** * Gets the width of the Chunk in points. * * @return a width in points */ public float getWidthPoint() { if (getImage() != null) { return getImage().getScaledWidth(); } return font.getCalculatedBaseFont(true).getWidthPoint(getContent(), font.getCalculatedSize()) * getHorizontalScaling(); }
/** * Gets the width of the Chunk in points. * * @return a width in points */ public float getWidthPoint() { if (getImage() != null) { return getImage().getScaledWidth(); } return font.getCalculatedBaseFont(true).getWidthPoint(getContent(), font.getCalculatedSize()) * getHorizontalScaling(); }
String c = chunk.getContent(); if (font != null && !font.isStandardFont()) { f = font.difference(chunk.getFont()); && (f == null || f.compareTo(previous.getFont()) == 0) && !"".equals(previous.getContent().trim()) && !"".equals(c.trim())) { previous.append(c);
String c = chunk.getContent(); if (font != null && !font.isStandardFont()) { f = font.difference(chunk.getFont()); && (f == null || f.compareTo(previous.getFont()) == 0) && !"".equals(previous.getContent().trim()) && !"".equals(c.trim())) { previous.append(c);