[英]Using a stylesheet with iText, possible?
Does iText provide/support for any kind of styling sheet? iText是否提供/支持任何类型的造型?
What I mean is, like in Apache FOP, the data is represented in the XML and the formatting is programmed in the XSL. 我的意思是,就像在Apache FOP中一样,数据以XML表示,格式化在XSL中编程。 So then we pass the XML and XSL to the FOP engine which in turn converts the data in XML using the formatting specified in the XSL to create a PDF. 然后我们将XML和XSL传递给FOP引擎,FOP引擎又使用XSL中指定的格式转换XML格式的数据以创建PDF。
Does iText support a similar functionality or the only way we have is to program the whole formatting in the Java code itself, meaning specifying the table/cell(its dimensions etc.), paragraph(its font, color etc.)? iText是否支持类似的功能,或者我们唯一的方法是在Java代码本身中编写整个格式,即指定表/单元格(其尺寸等),段落(字体,颜色等)?
iText isn't FOP, no. iText不是FOP,不是。 The only way is to program the whole formatting in the java code itself. 唯一的方法是在java代码本身中编写整个格式。 OTOH, Your program could read formatting information from various files in the format of your choice, but you'd have to write that code yourself. OTOH,您的程序可以以您选择的格式从各种文件中读取格式信息,但您必须自己编写该代码。
iText in Action 2nd ed has a sample that outlines building an XML parser and using that to feed iText. iText in Action 2nd ed有一个示例 ,概述了构建XML解析器并使用它来提供iText。 Nothing about style info other than what's written in the code. 除了在代码中编写的内容之外,没有任何关于样式信息的信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.