/** * Gets the indentation on the top side. * * @return a margin */ protected float indentTop() { return top(indentation.indentTop); }
public static float getAvailableHeight(PdfDocument pdfDocument) { Float indentBottom = pdfDocument.bottomMargin(); try { Method method = pdfDocument.getClass().getDeclaredMethod("indentBottom"); method.setAccessible(true); indentBottom = (Float) method.invoke(pdfDocument); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } float offset = pdfDocument.top() - pdfDocument.getVerticalPosition(false); return pdfDocument.getPageSize().getHeight() - offset - pdfDocument.topMargin() - indentBottom - pdfDocument.bottomMargin(); }
/** * Gets the indentation on the top side. * * @return a margin */ protected float indentTop() { return top(indentation.indentTop); }
/** * Gets the current vertical page position. * @param ensureNewLine Tells whether a new line shall be enforced. This may cause side effects * for elements that do not terminate the lines they've started because those lines will get * terminated. * @return The current vertical page position. */ public float getVerticalPosition(final boolean ensureNewLine) { // ensuring that a new line has been started. if (ensureNewLine) { ensureNewLine(); } return top() - currentHeight - indentation.indentTop; }
/** * Gets the current vertical page position. * @param ensureNewLine Tells whether a new line shall be enforced. This may cause side effects * for elements that do not terminate the lines they've started because those lines will get * terminated. * @return The current vertical page position. */ public float getVerticalPosition(final boolean ensureNewLine) { // ensuring that a new line has been started. if (ensureNewLine) { ensureNewLine(); } return top() - currentHeight - indentation.indentTop; }
protected void setNewPageSizeAndMargins() { pageSize = nextPageSize; if (marginMirroring && (getPageNumber() & 1) == 0) { marginRight = nextMarginLeft; marginLeft = nextMarginRight; } else { marginLeft = nextMarginLeft; marginRight = nextMarginRight; } if (marginMirroringTopBottom && (getPageNumber() & 1) == 0) { marginTop = nextMarginBottom; marginBottom = nextMarginTop; } else { marginTop = nextMarginTop; marginBottom = nextMarginBottom; } if (!isTagged(writer)) { text = new PdfContentByte(writer); text.reset(); } else { text = graphics; } text.beginText(); // we move to the left/top position of the page text.moveText(left(), top()); if (isTagged(writer)) textEmptySize = text.size(); }
protected void setNewPageSizeAndMargins() { pageSize = nextPageSize; if (marginMirroring && (getPageNumber() & 1) == 0) { marginRight = nextMarginLeft; marginLeft = nextMarginRight; } else { marginLeft = nextMarginLeft; marginRight = nextMarginRight; } if (marginMirroringTopBottom && (getPageNumber() & 1) == 0) { marginTop = nextMarginBottom; marginBottom = nextMarginTop; } else { marginTop = nextMarginTop; marginBottom = nextMarginBottom; } if (!isTagged(writer)) { text = new PdfContentByte(writer); text.reset(); } else { text = graphics; } text.beginText(); // we move to the left/top position of the page text.moveText(left(), top()); if (isTagged(writer)) textEmptySize = text.size(); }
doc.currentHeight = doc.top() - yLine - doc.indentation.indentTop; writableElement.write(writer, doc); doc.currentHeight = savedHeight;
doc.currentHeight = doc.top() - yLine - doc.indentation.indentTop; writableElement.write(writer, doc); doc.currentHeight = savedHeight;