开发者

Issue rendering Basic HTML (without inline CSS styles) using Flying Saucer ITextRenderer

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:-

<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 s开发者_JAVA技巧tyles which works perfectly fine. But my problem is I want the above HTML attributes to work due to several reasons...

Any helpful pointers will be appreciated.

Thanks,

Mangirish


Flying saucer doesn't support attributes on the <font> tag -- you need to use inline styles, like <font style="...">.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜