/** * Set the line dash pattern. * * @param pattern The pattern array * @param phase The phase of the pattern * @throws IOException If the content stream could not be written. * @throws IllegalStateException If the method was called within a text block. */ public void setLineDashPattern(float[] pattern, float phase) throws IOException { if (inTextMode) { throw new IllegalStateException("Error: setLineDashPattern is not allowed within a text block."); } write("["); for (float value : pattern) { writeOperand(value); } write("] "); writeOperand(phase); writeOperator("d"); }
/** * Writes an integer number to the content stream. * @param integer * @throws java.io.IOException */ protected void writeOperand(int integer) throws IOException { write(formatDecimal.format(integer)); outputStream.write(' '); }
/** * Shows the given text at the location specified by the current text matrix. * * @param text The Unicode text to show. * @throws IOException If an io exception occurs. * @throws IllegalArgumentException if a character isn't supported by the current font */ public void showText(String text) throws IOException { showTextInternal(text); write(" "); writeOperator("Tj"); }
write(sb.toString()); writeLine();
/** * Writes a real number to the content stream. * @param real * @throws java.io.IOException */ protected void writeOperand(float real) throws IOException { int byteCount = NumberFormatUtil.formatFloatFast(real, formatDecimal.getMaximumFractionDigits(), formatBuffer); if (byteCount == -1) { //Fast formatting failed write(formatDecimal.format(real)); } else { outputStream.write(formatBuffer, 0, byteCount); } outputStream.write(' '); }