3

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?

2
  • I dont have much idea about JXL api, but i think this might help you Commented 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 knows Commented Jul 24, 2014 at 5:17

1 Answer 1

4

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);
Sign up to request clarification or add additional context in comments.

3 Comments

You can try Aspose.Cells - if you have a couple of hundred $ in your pocket, of course.
but i want open source APi which convert excel to pdf at runtime because i have already create in excel file ..please suggest me
@KonstantinV.Salikhov a couple thousand dollars, that is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.