简体   繁体   English

XSL转换以创建PDF

[英]XSL Transformation to create PDF

I have an application in which I get data in XML and need to create PDFs on the basis of that data. 我有一个应用程序,其中以XML格式获取数据,并且需要根据该数据创建PDF。 The design of PDFs isn't static and will be defined by users. PDF的设计不是静态的,将由用户定义。 I want to do it using XSLT. 我想使用XSLT做到这一点。

Please have a look at the attached PDF and suggest whether creating this type of PDF through XSLT is feasible and advisable. 请查看随附的PDF,并提出通过XSLT创建这种类型的PDF是否可行且可取。 If yes, then some possible way to start and if no, then some alternatives would be really helpful. 如果是,那么某种可能的开始方式,如果不是,那么一些替代方法将非常有帮助。

Sample PDF - https://sabercathost.com/23Ye/ac.pdf 样本PDF- https://sabercathost.com/23Ye/ac.pdf

Thanks 谢谢

Nitin 尼丁

You are not able to render a PDF via XSLT. 您无法通过XSLT呈现PDF。 XSL transformations convert XML data into other formats (eg XML to XHTML). XSL转换将XML数据转换为其他格式(例如,XML到XHTML)。

There are several ways to render either formatting object language (FO) or HTML (+ paged media CSS) valid data with a PDF render tool such as the AntennaHouse Formatter (FO, HTML + CSS, XML + CSS), Prince or the open source software Apache FOP. 有多种方法可以使用PDF渲染工具(例如AntennaHouse Formatter(FO,HTML + CSS,XML + CSS),Prince或开源)来格式化目标语言(FO)或HTML(+分页媒体CSS)有效数据。软件Apache FOP。

So your PDF rendering process should look like this: 因此,您的PDF呈现过程应如下所示:

  1. Data Transformation via XSL into either XHTML or FO 通过XSL将数据转换为XHTML或FO
  2. PDF rendering with a PDF rendering Tool 使用PDF渲染工具进行PDF渲染

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM