Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试使用 java iText API 将 HTML 转换为 PDF,它也可以正常工作,但问题是 API 不允许包含外部 CSS。
谁能告诉我如何将带有外部css的html转换为pdf?
您可以在代码中内联 CSS,例如使用Jericho库。
您在他们的页面上有现成的代码示例:http: //jericho.htmlparser.net/samples/console/src/ConvertStyleSheets.java