while (true) { float left = indentLeft(); fl.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); try { int status = fl.layout(isTagged(writer) ? text : writer.getDirectContent(), false); text.setTextMatrix(indentLeft(), fl.getYLine()); } else { text.moveText(0, fl.getYLine() - indentTop() + currentHeight); currentHeight = indentTop() - fl.getYLine(); break; return; if (indentTop() - currentHeight == fl.getYLine() || isPageEmpty()) ++loop; else {
while (true) { float left = indentLeft(); fl.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); try { int status = fl.layout(isTagged(writer) ? text : writer.getDirectContent(), false); text.setTextMatrix(indentLeft(), fl.getYLine()); } else { text.moveText(0, fl.getYLine() - indentTop() + currentHeight); currentHeight = indentTop() - fl.getYLine(); break; return; if (indentTop() - currentHeight == fl.getYLine() || isPageEmpty()) ++loop; else {
if (currentHeight + calculateLineHeight() > indentTop() - indentBottom()) {
if (currentHeight + calculateLineHeight() > indentTop() - indentBottom()) {
int loop = 0; while (true) { ct.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); int status = ct.go(); if ((status & ColumnText.NO_MORE_TEXT) != 0) { 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)) {
int loop = 0; while (true) { ct.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); int status = ct.go(); if ((status & ColumnText.NO_MORE_TEXT) != 0) { 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);
/** * Checks if a <CODE>PdfPTable</CODE> fits the current page of the <CODE>PdfDocument</CODE>. * * @param table the table that has to be checked * @param margin a certain margin * @return <CODE>true</CODE> if the <CODE>PdfPTable</CODE> fits the page, <CODE>false</CODE> otherwise. */ boolean fitsPage(final PdfPTable table, final float margin) { if (!table.isLockedWidth()) { float totalWidth = (indentRight() - indentLeft()) * table.getWidthPercentage() / 100; table.setTotalWidth(totalWidth); } // ensuring that a new line has been started. ensureNewLine(); Float spaceNeeded = table.isSkipFirstHeader() ? table.getTotalHeight() - table.getHeaderHeight() : table.getTotalHeight(); return spaceNeeded + (currentHeight > 0 ? table.spacingBefore() : 0f) <= indentTop() - currentHeight - indentBottom() - margin; }
/** * Checks if a <CODE>PdfPTable</CODE> fits the current page of the <CODE>PdfDocument</CODE>. * * @param table the table that has to be checked * @param margin a certain margin * @return <CODE>true</CODE> if the <CODE>PdfPTable</CODE> fits the page, <CODE>false</CODE> otherwise. */ boolean fitsPage(final PdfPTable table, final float margin) { if (!table.isLockedWidth()) { float totalWidth = (indentRight() - indentLeft()) * table.getWidthPercentage() / 100; table.setTotalWidth(totalWidth); } // ensuring that a new line has been started. ensureNewLine(); Float spaceNeeded = table.isSkipFirstHeader() ? table.getTotalHeight() - table.getHeaderHeight() : table.getTotalHeight(); return spaceNeeded + (currentHeight > 0 ? table.spacingBefore() : 0f) <= indentTop() - currentHeight - indentBottom() - margin; }
if ( currentHeight + height > indentTop() - indentBottom() ) { newPage(); return;
if ( currentHeight + height > indentTop() - indentBottom() ) { newPage(); return;
if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { if (!strictImageSequence && imageWait == null) { imageWait = image; if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { imageWait = image; return; diff += leading; float lowerleft = indentTop() - currentHeight - image.getScaledHeight() -diff; float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4];
if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { if (!strictImageSequence && imageWait == null) { imageWait = image; if (currentHeight != 0 && indentTop() - currentHeight - image.getScaledHeight() < indentBottom()) { imageWait = image; return; diff += leading; float lowerleft = indentTop() - currentHeight - image.getScaledHeight() -diff; float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4];
Rectangle rect = new Rectangle(0, 0); if (line != null) rect = new Rectangle(annot.llx(indentRight() - line.widthLeft()), annot.ury(indentTop() - currentHeight - 20), annot.urx(indentRight() - line.widthLeft() + 20), annot.lly(indentTop() - currentHeight)); PdfAnnotation an = PdfAnnotationsImp.convertAnnotation(writer, annot, rect); annotationsImp.addPlainAnnotation(an); if (currentHeight + calculateLineHeight() > indentTop() - indentBottom()) { newPage(); pageEvent.onParagraph(writer, this, indentTop() - currentHeight); pageEvent.onParagraphEnd(writer, this, indentTop() - currentHeight); float fith = indentTop() - currentHeight; int rotation = pageSize.getRotation(); if (rotation == 90 || rotation == 180) pageEvent.onChapter(writer, this, indentTop() - currentHeight, section.getTitle()); else pageEvent.onSection(writer, this, indentTop() - currentHeight, section.getDepth(), section.getTitle()); pageEvent.onChapterEnd(writer, this, indentTop() - currentHeight); else pageEvent.onSectionEnd(writer, this, indentTop() - currentHeight); zh.draw(graphics, indentLeft(), indentBottom(), indentRight(), indentTop(), indentTop() - currentHeight - (leadingStack.size() > 0 ? leading : 0)); pageEmpty = false; break;
Rectangle rect = new Rectangle(0, 0); if (line != null) rect = new Rectangle(annot.llx(indentRight() - line.widthLeft()), annot.ury(indentTop() - currentHeight - 20), annot.urx(indentRight() - line.widthLeft() + 20), annot.lly(indentTop() - currentHeight)); PdfAnnotation an = PdfAnnotationsImp.convertAnnotation(writer, annot, rect); annotationsImp.addPlainAnnotation(an); if (currentHeight + calculateLineHeight() > indentTop() - indentBottom()) { newPage(); pageEvent.onParagraph(writer, this, indentTop() - currentHeight); pageEvent.onParagraphEnd(writer, this, indentTop() - currentHeight); float fith = indentTop() - currentHeight; int rotation = pageSize.getRotation(); if (rotation == 90 || rotation == 180) pageEvent.onChapter(writer, this, indentTop() - currentHeight, section.getTitle()); else pageEvent.onSection(writer, this, indentTop() - currentHeight, section.getDepth(), section.getTitle()); pageEvent.onChapterEnd(writer, this, indentTop() - currentHeight); else pageEvent.onSectionEnd(writer, this, indentTop() - currentHeight); zh.draw(graphics, indentLeft(), indentBottom(), indentRight(), indentTop(), indentTop() - currentHeight - (leadingStack.size() > 0 ? leading : 0)); pageEmpty = false; break;