首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >多个XSL到单个PDF

多个XSL到单个PDF
EN

Stack Overflow用户
提问于 2011-07-12 21:55:13
回答 1查看 778关注 0票数 2

我们有5个xsl文件,用于转换的xml内容是在运行时生成的,当我们为单个xsl文件生成单个pdf时,它工作得很好。

我们的需求是需要基于运行时输入为5个xsl文件生成单个pdf。

例如:输入的是3xsl文件名,然后我们需要生成一个包含多个页面中3xsl内容的单个pdf。

我们使用的是Apache FOP 1.0和Java 1.5。

提前感谢

谢谢-Arul

EN

回答 1

Stack Overflow用户

发布于 2011-07-13 02:37:51

由于您已经能够将XSL转换为PDF,因此可以尝试使用Aspose.Pdf.Kit for Java将从这些XSL文件创建的concatenate multiple PDF files转换为单个PDF。代码非常简单:

代码语言:javascript
复制
//read the input file
String inFile1 = "example1.pdf";
String inFile2 = "example2.pdf";
String outFile = "kitOut1.pdf";

FileInputStream inStream1 = new FileInputStream(inFile1);
FileInputStream inStream2 = new FileInputStream(inFile2);


//concatenate two files
FileOutputStream outputStream = new FileOutputStream(outFile);
PdfFileEditor editor = new PdfFileEditor();
editor.concatenate(inStream1, inStream2, outputStream);

//close the output FileOutputStream
outputStream.close();

披露:我是Aspose的开发者布道者。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6665313

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档