How to change line thickness in iText?

Posted by drasto on Stack Overflow See other posts from Stack Overflow or by drasto
Published on 2010-05-03T11:55:13Z Indexed on 2010/05/03 12:08 UTC
Read the original article Hit count: 436

Filed under:
|
|

I'm drawing images to pdf using Java framework iText. I need to draw lines of specified width. There is a method setLineWidth(float width) in class PdfContentByte that should change it. However no matter what value I pass as its parameter the lines drawn are always extra thin.

There is following line in javadoc of setLineWidth:

The line width specifies the thickness of the line used to stroke a path and is measured in user space units.

I don't know what is "space unit". Everything else in iText seems to be measured in point(around 1/72 inch). I cant find any reference to what are those "space units" and how to change them.

code:

to.setLineWidth(thickness);
to.moveTo(x, y);
to.lineTo(x + 100, y + 100);

Variable to contains instance of PdfContentByte.

© Stack Overflow or respective owner

Related posts about java

Related posts about itext