PdfReader reader = new PdfReader(SRC3); page = copy.getImportedPage(reader, 1); stamp = copy.createPageStamp(page); Paragraph p; PdfAction action; PdfAnnotation link; float y = 770; ColumnText ct = new ColumnText(stamp.getOverContent()); ct.setSimpleColumn(36, 36, 559, y); for (Map.Entry<Integer, String> entry : toc.entrySet()) { p = new Paragraph(entry.getValue()); p.add(new Chunk(new DottedLineSeparator())); p.add(String.valueOf(entry.getKey())); ct.addElement(p); ct.go(); action = PdfAction.gotoLocalPage("p" + entry.getKey(), false); link = new PdfAnnotation(copy, 36, ct.getYLine(), 559, y, action); stamp.addAnnotation(link); y = ct.getYLine(); } ct.go(); stamp.alterContents(); copy.addPage(page);
// I define a width of 200pt float width = 200; // I define the height as 10000pt (which is much more than I'll ever need) float max = 10000; // I create a column without a `writer` (strange, but it works) ColumnText ct = new ColumnText(null); ct.setSimpleColumn(new Rectangle(width, max)); for (Element e : el) { ct.addElement(e); } // I add content in simulation mode ct.go(true); // Now I ask the column for its Y position float y = ct.getYLine();
if ((status & ColumnText.NO_MORE_TEXT) != 0) { if (isTagged(writer)) { text.setTextMatrix(indentLeft(), ct.getYLine()); } else { text.moveText(0, ct.getYLine() - indentTop() + currentHeight); currentHeight = indentTop() - ct.getYLine(); break; if (indentTop() - currentHeight == ct.getYLine()) ++loop; else throw new DocumentException(MessageLocalization.getComposedMessage("infinite.table.loop")); currentHeight = indentTop() - ct.getYLine(); newPage(); if (isTagged(writer)) {
if ((status & ColumnText.NO_MORE_TEXT) != 0) { if (isTagged(writer)) { text.setTextMatrix(indentLeft(), ct.getYLine()); } else { text.moveText(0, ct.getYLine() - indentTop() + currentHeight); currentHeight = indentTop() - ct.getYLine(); break; if (indentTop() - currentHeight == ct.getYLine()) ++loop; else throw new DocumentException(MessageLocalization.getComposedMessage("infinite.table.loop")); currentHeight = indentTop() - ct.getYLine(); newPage(); ptable.setSkipFirstHeader(false);
minYLine = currentCompositeColumn.getYLine() + currentCompositeColumn.getDescender(); yLine = minYLine; if (currentCompositeColumn.getFilledWidth() > filledWidth) { filledWidth = currentCompositeColumn.getFilledWidth(); minYLine = Math.min(currentCompositeColumn.getYLine() + currentCompositeColumn.getDescender(), minYLine); yLine = currentCompositeColumn.getYLine() + currentCompositeColumn.getDescender();
minYLine = currentCompositeColumn.getYLine() + currentCompositeColumn.getDescender(); yLine = minYLine; if (currentCompositeColumn.getFilledWidth() > filledWidth) { filledWidth = currentCompositeColumn.getFilledWidth(); minYLine = Math.min(currentCompositeColumn.getYLine() + currentCompositeColumn.getDescender(), minYLine); yLine = currentCompositeColumn.getYLine() + currentCompositeColumn.getDescender();
throw new ExceptionConverter(e); boolean thisEmpty = (ct.getYLine() == y); if (thisEmpty) { newCell.setColumn(ColumnText.duplicate(cell.getColumn()));
throw new ExceptionConverter(e); boolean thisEmpty = (ct.getYLine() == y); if (thisEmpty) { newCell.setColumn(ColumnText.duplicate(cell.getColumn()));
setBottom(getTop() - getEffectivePaddingTop() - getEffectivePaddingBottom() - ct.getFilledWidth()); } else { float yLine = ct.getYLine(); if (isUseDescender()) { yLine += ct.getDescender();
setBottom(getTop() - getEffectivePaddingTop() - getEffectivePaddingBottom() - ct.getFilledWidth()); } else { float yLine = ct.getYLine(); if (isUseDescender()) { yLine += ct.getDescender();
throw new ExceptionConverter(e); float calcHeight = -ct.getYLine(); if (netWidth <= 0 || netHeight <= 0) { calcHeight = 0;
throw new ExceptionConverter(e); float calcHeight = -ct.getYLine(); if (netWidth <= 0 || netHeight <= 0) { calcHeight = 0;