/** * Fill the path. * * @param windingRule the winding rule to be used for filling * @throws IOException If the content stream could not be written * @throws IllegalArgumentException If the parameter is not a valid winding rule. * @deprecated Use {@link #fill()} or {@link #fillEvenOdd} instead. */ @Deprecated public void fill(int windingRule) throws IOException { switch (windingRule) { case PathIterator.WIND_NON_ZERO: fill(); break; case PathIterator.WIND_EVEN_ODD: fillEvenOdd(); break; default: throw new IllegalArgumentException("Error: unknown value for winding rule"); } }
/** * Draw and fill a polygon on the page using the current stroking / non stroking colors. * @param x x coordinate of each points * @param y y coordinate of each points * @throws IOException If there is an error while drawing on the screen. * @throws IllegalStateException If the method was called within a text block. * @deprecated Use {@link #moveTo} and {@link #lineTo} methods instead. */ @Deprecated public void fillPolygon(float[] x, float[] y) throws IOException { if (inTextMode) { throw new IllegalStateException("Error: fillPolygon is not allowed within a text block."); } addPolygon(x, y); fill(); }
/** * Fill a rectangle on the page using the current non stroking color. * * @param x The lower left x coordinate. * @param y The lower left y coordinate. * @param width The width of the rectangle. * @param height The height of the rectangle. * @throws IOException If there is an error while drawing on the screen. * @throws IllegalStateException If the method was called within a text block. * @deprecated Use {@link #addRect} followed by {@link #fill()} instead. */ @Deprecated public void fillRect(float x, float y, float width, float height) throws IOException { if (inTextMode) { throw new IllegalStateException("Error: fillRect is not allowed within a text block."); } addRect(x, y, width, height); fill(); }
/** * Fill the path. * * @param windingRule the winding rule to be used for filling * @throws IOException If the content stream could not be written * @throws IllegalArgumentException If the parameter is not a valid winding rule. * @deprecated Use {@link #fill()} or {@link #fillEvenOdd} instead. */ @Deprecated public void fill(int windingRule) throws IOException { switch (windingRule) { case PathIterator.WIND_NON_ZERO: fill(); break; case PathIterator.WIND_EVEN_ODD: fillEvenOdd(); break; default: throw new IllegalArgumentException("Error: unknown value for winding rule"); } }
public void fillNonZero() { try { cs.fill(); } catch (IOException e) { logAndThrow("fillNonZero", e); } }
public void fillNonZero() { try { cs.fill(); } catch (IOException e) { logAndThrow("fillNonZero", e); } }
/** * Draw and fill a polygon on the page using the current stroking / non stroking colors. * @param x x coordinate of each points * @param y y coordinate of each points * @throws IOException If there is an error while drawing on the screen. * @throws IllegalStateException If the method was called within a text block. * @deprecated Use {@link #moveTo} and {@link #lineTo} methods instead. */ @Deprecated public void fillPolygon(float[] x, float[] y) throws IOException { if (inTextMode) { throw new IllegalStateException("Error: fillPolygon is not allowed within a text block."); } addPolygon(x, y); fill(); }
/** * Fill a rectangle on the page using the current non stroking color. * * @param x The lower left x coordinate. * @param y The lower left y coordinate. * @param width The width of the rectangle. * @param height The height of the rectangle. * @throws IOException If there is an error while drawing on the screen. * @throws IllegalStateException If the method was called within a text block. * @deprecated Use {@link #addRect} followed by {@link #fill()} instead. */ @Deprecated public void fillRect(float x, float y, float width, float height) throws IOException { if (inTextMode) { throw new IllegalStateException("Error: fillRect is not allowed within a text block."); } addRect(x, y, width, height); fill(); }
public void fillRect(float x, float y, float w, float h) { try { cs.addRect(x, y, w, h); cs.fill(); } catch (IOException e) { logAndThrow("fillRect", e); } }
/** * Draw and fill a polygon on the page using the current stroking / non stroking colors. * @param x x coordinate of each points * @param y y coordinate of each points * @throws IOException If there is an error while drawing on the screen. * @throws IllegalStateException If the method was called within a text block. * @deprecated Use {@link #moveTo} and {@link #lineTo} methods instead. */ @Deprecated public void fillPolygon(float[] x, float[] y) throws IOException { if (isInTextMode()) { throw new IllegalStateException("Error: fillPolygon is not allowed within a text block."); } addPolygon(x, y); fill(); }
public void fillRect(float x, float y, float w, float h) { try { cs.addRect(x, y, w, h); cs.fill(); } catch (IOException e) { logAndThrow("fillRect", e); } }
/** * Fill a rectangle on the page using the current non stroking color. * * @param x The lower left x coordinate. * @param y The lower left y coordinate. * @param width The width of the rectangle. * @param height The height of the rectangle. * @throws IOException If there is an error while drawing on the screen. * @throws IllegalStateException If the method was called within a text block. * @deprecated Use {@link #addRect} followed by {@link #fill()} instead. */ @Deprecated public void fillRect(float x, float y, float width, float height) throws IOException { if (isInTextMode()) { throw new IllegalStateException("Error: fillRect is not allowed within a text block."); } addRect(x, y, width, height); fill(); }
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) { try { if (bgcolor != null) { contentStream.setNonStrokingColor(colorMapper.mapColor(contentStream, bgcolor)); walkShape(new Rectangle(x, y, width, height)); contentStream.fill(); } return drawImage(img, x, y, img.getWidth(observer), img.getHeight(observer), observer); } catch (IOException e) { throwException(e); return false; } }
void drawRect(PDPageContentStream content, Color color, Rectangle rect, boolean fill) { content.addRect(rect.x, rect.y, rect.width, rect.height); if (fill) { content.setNonStrokingColor(color); content.fill(); } else { content.setStrokingColor(color); content.stroke(); } }
public PDRectangle drawRectangle(final float x, final float y, final float width, final float height, final Color color) throws IOException { final float startingY = checkYAndSwitchPage(y, height); contentStream.setNonStrokingColor(color); contentStream.addRect(x, startingY, width, height); contentStream.fill(); return new PDRectangle(x, startingY, width, height); }
@Override public void commit(PDPageContentStream stream) throws IOException { stream.setNonStrokingColor(color); stream.addRect(toFloat(x), toFloat(y), toFloat(width), toFloat(height)); stream.fill(); } }
private void fillCellColor(Cell<T> cell, float yStart, float xStart, Iterator<Cell<T>> cellIterator) throws IOException { if (cell.getFillColor() != null) { this.tableContentStream.setNonStrokingColor(cell.getFillColor()); // y start is bottom pos yStart = yStart - cell.getHeight(); float height = cell.getHeight() - (cell.getTopBorder() == null ? 0 : cell.getTopBorder().getWidth()); float cellWidth = getWidth(cell, cellIterator); this.tableContentStream.addRect(xStart, yStart, cellWidth, height); this.tableContentStream.fill(); this.tableContentStream.closePath(); // Reset NonStroking Color to default value this.tableContentStream.setNonStrokingColor(Color.BLACK); } }