我正在尝试为 XML 文档生成 postscript 文件。我可以使用 xsltproc 生成纯文本或html输出。
xsltproc --output output.txt xslFile.xsl input.xml
有没有办法从命令行生成 postscript 文件或使用C编程?
答案 0 :(得分:1)
实现此目的的一种可能性是将XML文件转换为XSL-FO
,然后使用Apache-FOP将其转换为带有
fop -xml input.xml -xsl xml2fo.xsl -ps output.ps
目前我无法在网上找到一个简单的XSL文件来完成此任务,但这取决于您对输出的看法。为这个转换创建一个基本的XSLT不应该那么难。
编辑:仅为了完整性:Apache-FOP
的可能输出格式为
-pdf outfile input will be rendered as PDF (outfile req'd)
-pdfa1b outfile input will be rendered as PDF/A-1b compliant PDF
(outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
-awt input will be displayed on screen
-rtf outfile input will be rendered as RTF (outfile req'd)
-pcl outfile input will be rendered as PCL (outfile req'd)
-ps outfile input will be rendered as PostScript (outfile req'd)
-afp outfile input will be rendered as AFP (outfile req'd)
-tiff outfile input will be rendered as TIFF (outfile req'd)
-png outfile input will be rendered as PNG (outfile req'd)
-txt outfile input will be rendered as plain text (outfile req'd)