/** * Adds the current line to the list of lines and also adds an empty line. * @throws DocumentException on error */ protected void newLine() throws DocumentException { lastElementType = -1; carriageReturn(); if (lines != null && !lines.isEmpty()) { lines.add(line); currentHeight += line.height(); } line = new PdfLine(indentLeft(), indentRight(), alignment, leading); }
/** * Adds the current line to the list of lines and also adds an empty line. * @throws DocumentException on error */ protected void newLine() throws DocumentException { lastElementType = -1; carriageReturn(); if (lines != null && !lines.isEmpty()) { lines.add(line); currentHeight += line.height(); } line = new PdfLine(indentLeft(), indentRight(), alignment, leading); }
line = new PdfLine(indentLeft(), indentRight(), alignment, leading);
line = new PdfLine(indentLeft(), indentRight(), alignment, leading);
/** * 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; }
line = new PdfLine(indentLeft(), indentRight(), alignment, leading);
line = new PdfLine(indentLeft(), indentRight(), alignment, leading);
while (true) { float left = indentLeft(); fl.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); try { int status = fl.layout(isTagged(writer) ? text : writer.getDirectContent(), false);
while (true) { float left = indentLeft(); fl.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); try { int status = fl.layout(isTagged(writer) ? text : writer.getDirectContent(), false);
float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4]; if ((image.getAlignment() & Image.RIGHT) == Image.RIGHT) startPosition = indentRight() - image.getScaledWidth() - mt[4]; if ((image.getAlignment() & Image.MIDDLE) == Image.MIDDLE) startPosition = indentLeft() + (indentRight() - indentLeft() - image.getScaledWidth()) / 2 - mt[4]; if (image.hasAbsoluteX()) startPosition = image.getAbsoluteX(); if (textwrap) {
float mt[] = image.matrix(); float startPosition = indentLeft() - mt[4]; if ((image.getAlignment() & Image.RIGHT) == Image.RIGHT) startPosition = indentRight() - image.getScaledWidth() - mt[4]; if ((image.getAlignment() & Image.MIDDLE) == Image.MIDDLE) startPosition = indentLeft() + (indentRight() - indentLeft() - image.getScaledWidth()) / 2 - mt[4]; if (image.hasAbsoluteX()) startPosition = image.getAbsoluteX(); if (textwrap) {
int loop = 0; while (true) { ct.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); int status = ct.go(); if ((status & ColumnText.NO_MORE_TEXT) != 0) {
int loop = 0; while (true) { ct.setSimpleColumn(indentLeft(), indentBottom(), indentRight(), indentTop() - currentHeight); int status = ct.go(); if ((status & ColumnText.NO_MORE_TEXT) != 0) {
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); 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); zh.draw(graphics, indentLeft(), indentBottom(), indentRight(), indentTop(), indentTop() - currentHeight - (leadingStack.size() > 0 ? leading : 0)); pageEmpty = false; break;