PDFBox change color of a line

2019-07-23 06:59发布

问题:

I work with pdfbox 1.8.5 and I try to draw a colored Line using PDPageContentStream.drawLine().

I tried it with PDPageContentStream.setNonStrokingColor( 255, 0, 0 ); but it doesn't work. I also didn´t find any examples or HowTos concerning Line Color.

Does anyone know, how I can change the Line Color?

回答1:

Try this method. It's working for me.

contentStream.setStrokingColor(229, 13, 209);


标签: java pdf pdfbox