We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

What is the best way to convert xls to pdf

Hello,

I had a look at http://www.aspose.com/documentation/java-components/aspose.cells-for-java/converting-to-pdf-files.html which describes 2 ways how to get a workbook converted to pdf.

With the 7.0.2 Version of Aspose.Cells ene enum FileFormatType.ASPOSE_PDF is marked deprecated and a hint is given to use FileFormatType.PDF.

a) What is the best official way to to this conversion without loosing to much detail?

b) If I use FileFormatType.PDF, how can I set stuff like:
final Security security = result.getSecurity();
security.setIsPrintingAllowed(true);
security.setIsCopyingAllowed(true);

c) Are there currently known issues with FileFormatType.PDF? My 1st try did prodice a broken PDF.


Kind Regards,

Andreas.

Hi,


a) The Direct Conversion (second way) is most efficient/best approach that you should use now with latest versions e.g 7.x.x. It will not loose your data / formatting in most cases. This approach does not require Aspose.Pdf product as Aspose.Cells for Java can alone convert Excel spreadsheets to PDF.

2) You may use PdfSaveOptions to specify the Security options. Brows and check “PdfSecurityOptions” and set your desired options accordingly before converting to PDF. See the document for reference, although the document uses .NET version but you may convert the code segments to Java version accordingly:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/secure-pdf-documents.html

3) Please check a) and use Direct Conversion, it will convert with accurately and sameness.

Thank you.


Hi,

thanks for the answer. This works fine, I suggest you update the java documentation accordingly :slight_smile:

Kind Regards,

Andreas.

Hi,


Good to know that your issue is resolved.

Some of our older users are still using this approach with their older versions. Anyways, thanks for the tip and we will update (will add/update a few lines accordingly on which is good approach for getting best results regarding performance, efficiency, accuracy etc.) the document soon.

Thank you.