Because I have used JXL api for excel but now I want to convert it to Pdf file so please tell me how to change my code to convert excel to pdf?
-
I dont have much idea about JXL api, but i think this might help youMustafa sabir– Mustafa sabir2014-07-24 05:12:52 +00:00Commented Jul 24, 2014 at 5:12
-
jxl is a API only used for excel file like itext for PDFs but here i want to change excel, created by jxl API to dynamically change in pdf..please tell me anyone knowsuser3800534– user38005342014-07-24 05:17:44 +00:00Commented Jul 24, 2014 at 5:17
Add a comment
|
1 Answer
You could use iText to create a pdf file in java and use Apache POI to access the data in the MS-EXCEL file. If you combine both, you could convert your excel file.
A raw example is given here
Also, there is this new API: You can try Aspose.Cells for Java which allows you to convert Excel file to PDF in Java applications. It doesn't require MS Office/OpenOffice etc to be installed on your development or deployment machine. It also works on both Windows and Linux platforms. The code is very simple as shown below:
//Instantiate a new workbook with excel file path
Workbook workbook = new Workbook("F:\\FileTemp\\Book1.xls");
//Save the document in Pdf format
workbook.save("F:\\FileTemp\\MyPdfFile.pdf", FileFormatType.PDF);
3 Comments
Konstantin V. Salikhov
You can try Aspose.Cells - if you have a couple of hundred $ in your pocket, of course.user3800534
but i want open source APi which convert excel to pdf at runtime because i have already create in excel file ..please suggest me
Cardinal System
@KonstantinV.Salikhov a couple thousand dollars, that is.