I am very new to Flying Saucer. I am generating PDFs using ITextRenderer class in Java. The problem that I am facng is, the HTML that i need to convert, contains basic HTML tags WITHOUT INLINE CSS STYLES. For Example:-
我对Flying Saucer很新。我正在使用Java中的ITextRenderer类生成PDF。我面临的问题是,我需要转换的HTML包含没有INLINE CSS STYLES的基本HTML标签。例如:-
<p><b>hello</b> <i>this</i> is a <u>sample</u>
<font color="#FF6600">text for HTML</font> to pdf <font size="18">gen</font></p>
What I notice is that, in the above HTML, the attributes of font tag (size, color etc) have no effect in the PDF. Whereas, I have also been experimenting by hardcoding an HTML with inline CSS styles which works perfectly fine. But my problem is I want the above HTML attributes to work due to several reasons...
我注意到,在上面的HTML中,字体标记(大小,颜色等)的属性对PDF没有影响。然而,我也一直在尝试使用内联CSS样式对HTML进行硬编码,这种样式非常合适。但我的问题是我希望上面的HTML属性能够正常工作......
Any helpful pointers will be appreciated.
任何有用的指针将不胜感激。
Thanks,
Mangirish
1 个解决方案
#1
0
Flying saucer doesn't support attributes on the <font>
tag -- you need to use inline styles, like <font style="...">
.
飞碟不支持标签上的属性 - 您需要使用内联样式,例如。
#1
0
Flying saucer doesn't support attributes on the <font>
tag -- you need to use inline styles, like <font style="...">
.
飞碟不支持标签上的属性 - 您需要使用内联样式,例如。