是否可以使用 itext 7+ 添加具有渐变颜色的文本?
我试过这样做但没有帮助
AbstractLinearGradientBuilder gradientBuilder = new LinearGradientBuilder()
.setGradientVector(A6.getLeft(), A6.getLeft(), A6.getRight(), A6.getRight())
.addColorStop(new GradientColorStop(COLOR_PURPLE.getColorValue()))
.addColorStop(new GradientColorStop(COLOR_RED.getColorValue()));
BackgroundImage backgroundImage = new BackgroundImage.Builder()
.setLinearGradientBuilder(gradientBuilder)
.build();
Text text = new Text(code);
text.setProperty(Property.BACKGROUND_IMAGE, List.of(backgroundImage));