Currently I am having a requirement to download multiple files (PDF , XLXS , PPT , JPEG , PNG) from SFTP Server and then merge it to a one PDF File and provide to the client in order take a printout. I thought of using ITEXT library to convert all files to PDF and then perform a PDF Merge , but don't know weather it is possible, Thus I am requesting a support from you guys for a better approach to perform the task. I have already performed the file download using JSCH from SFTP to the server.
Asked
Active
Viewed 979 times
-1
-
1iText is no converter. It does allow you to embed bitmap images in some formats into PDFs but by itself it does not conversion of arbitrary office formats to PDF. Thus, you should first look for ways to convert the input office formats to PDF. Once you have that, you can start using iText core to merge these PDFs and embed bitmaps. – mkl Jan 11 '21 at 12:05
-
@mkl Thank you for your comment , Do you suggest any libraries to convert files to pdf , specially formats like , xlsx ,docx , pptx ?? – cs-87 Jan 11 '21 at 12:08
-
For software recommendations please ask on [softwarerecs.se]. Also I have no hands-on experiences with conversion libraries, I'm mostly into PDF manipulation. – mkl Jan 11 '21 at 12:21
2 Answers
1
You can merge multiple PDF documents into a single PDF document using the class named PDFMergerUtility class, this class provides methods to merge two or more PDF documents in to a single PDF document.

Tushar Adhatrao
- 33
- 4
-
Thank you for your comment , But Currently i have files with different formats (PDF , XLXS , PPT , JPEG , PNG) which needed to be merged to a one PDF file with conversion. Do you have any idea ? Appreciate your valuable comments – cs-87 Jan 11 '21 at 11:22
0
Answering to My Own question to Benefit another person. In order to Convert Files with extensions docx , xlsx , pptx) Used Spire.Office for Java (Free Evaluation version available)
Also I tried aspose cells libray as well (Free Evaluation available) to convert xlsx to PDF as well. Both Libraries worked fine and hassle free , But all libraries were not free.
Then Merged all the PDF Files using ITEXT Library. If Someone is having a better alternative answer , kindly share.
For multiple files merge, you can refer This Example

cs-87
- 186
- 1
- 6
- 18