How to draw dotted line in pdfBox
1 answer
Use the setLineDashPattern () call before making the drawLine call:
public void setLineDashPattern(float[] pattern, float phase)
Example:
setLineDashPattern (new float[]{3}, 0);
the line pattern will be set from 3 to, 3 off, 3 to, 3 off. etc.
setLineDashPattern (new float[]{3,1}, 0);
configures a linear pattern with 3 on, 1 off, 3 on. etc.
for more details on the dash, see the PDF specification .
+5
source to share