List of usage examples for com.itextpdf.text Rectangle setUseVariableBorders
public void setUseVariableBorders(final boolean useVariableBorders)
From source file:fc.extensions.itext.Writer.java
License:MIT License
public void drawRectangleWithVariableBorder(Position position, float lineWidth, int borderType) { try {/*from w w w . java 2 s. c o m*/ pdfWriterCB.saveState(); pdfWriterCB.setRGBColorStroke(0, 0, 0); Rectangle rectangle = new Rectangle(position.getLeft(), position.getBottom(), position.getRight(), position.getTop()); rectangle.setBorderWidth(lineWidth); rectangle.setBorder(borderType); rectangle.setUseVariableBorders(true); pdfWriterCB.rectangle(position.getLeft(), position.getBottom(), position.getWidth(), position.getHeight()); pdfWriterCB.stroke(); } finally { pdfWriterCB.restoreState(); } }