是否有可以在QT中使用的用C++编写的xsl-fo to PDF引擎?
到目前为止,我遇到的引擎都是用 java 编写的。
最佳答案
您应该使用 QXmlQuery:link
来自 qt 文档:
Running an XSLT stylesheet is like running an XQuery, except that when you construct your QXmlQuery, you must pass QXmlQuery::XSLT20 to tell QXmlQuery to interpret whatever it gets from setQuery() as an XSLT stylesheet instead of as an XQuery. You must also set the input document by calling setFocus().
代码:
QXmlQuery query(QXmlQuery::XSLT20);
query.setFocus(QUrl("myInput.xml"));
query.setQuery(QUrl("myStylesheet.xsl"));
query.evaluateTo(out);
其中“out”是 pdf 文件。和 xsl 文件定义如何将 xml 文件转换为 pdf。
关于c++ - 是否有免费的 C++ xsl-fo 转 PDF 引擎?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5911055/