aspose-cells / Aspose.Cells-for-Java

Aspose.Cells for Java examples, plugins and showcases
https://products.aspose.com/cells/java
MIT License
148 stars 102 forks source link

No Android Support #40

Closed Rahulgupta-cdnsol closed 6 years ago

Rahulgupta-cdnsol commented 6 years ago

Hi,

I have gone through with the sample code and I need to integrate this in my android app.In aspose portal you have mentioned it as library for Android via Java but it doesn't seem support the Android. Can you please let me know how we can use the library in android app.

Thanks,

shakeel-faiz commented 6 years ago

@Rahulgupta-cdnsol

Please consider these APIs

1 - Aspose.Cells for Java (It is released after every month) 2 - Aspose.Cells for Android via Java (It is released after couple of months)

The most recent version of Aspose.Cells for Android via Java is 18.3 which is released just recently. The jar file name is

aspose-cells-18.3-android.via.java.jar

You can download this jar from this Maven repo link.

http://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-cells/18.3/

And this is the direct link.

http://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-cells/18.3/aspose-cells-18.3-android.via.java.jar

After downloading the correct jar, your issue should be resolved. Let us know if you need more help. Thank you and have a good day.

Rahulgupta-cdnsol commented 6 years ago

It does not work properly with XLS as I have 6 column and it breaks and columns are not showing altogether.Please have a look reference xls and its converted pdf. sample.pdf

So please let me know how this can be fix where all the columns will be visible.

shakeel-faiz commented 6 years ago

@Rahulgupta-cdnsol

Please provide us your sample Excel file which you are converting to Pdf and sample code. Please also provide us your expected Pdf which you could create by opening your Excel file in Microsoft Excel and then saving it to Pdf format. We will look into it and help you asap.

Rahulgupta-cdnsol commented 6 years ago

Hi,

When you convert an XLS file to pdf it will not give you correct format but like as ASpose API is paid so should provide a solution where XLS file should be shown properly. I am attaching XLS file here.Please let me know the solution how XLS can be shown properly. Thanks, sample1.xlsx

shakeel-faiz commented 6 years ago

@Rahulgupta-cdnsol

In order to get correct output, you should know what fonts are being used inside your Excel file. You can find them using the Workbook.getFonts() method. For example, your sample1.xls file needs these two fonts.

Then you should get these font files from internet or your windows machines and place them in your android OS directory and set the font folder. Only, then you will get correct output in pdf format.

Suppose, you place font files in this directory

/abc/def/gh

Now, you will set font folder like this

String fontFolder = "/abc/def/gh";
FontConfigs.setFontFolder(fontFolder, true);

I have also checked the sample.pdf shared by you, it uses wrong font i.e. BPGArial because it could not find correct font.

For more detail, please go through the fonts section and its two articles thoroughly. It should fix your issues.