Class com.aspose.pdf.exceptions.PdfException: Unsupported load format

Hi, I’m very new to this, I just wanted to make an application that would make my life easier, but I got the following error while converting an html file to a pdf file. Maybe this is something that can be solved very easily, but I couldn’t find a solution for 3 days. Could someone help me?

part of my basic code:

String downloadsPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();

            String htmlFilePath = downloadsPath + "/test.html";
            String pdfFilePath = downloadsPath + "/output.pdf";

            try {
                HtmlLoadOptions htmloptions = new HtmlLoadOptions();

                Document doc = new Document(new FileInputStream(htmlFilePath), htmloptions);

                doc.save(pdfFilePath);

            } catch (IOException e) {
                throw new RuntimeException(e);
            }

and error:

E  FATAL EXCEPTION: main  | look right for error ------>
                                                                                                    Process: com.lyki.easyapp, PID: 19247
                                                                                                    class com.aspose.pdf.exceptions.PdfException: Unsupported load format
                                                                                                    com.aspose.pdf.ADocument.m1(Unknown Source:44)
                                                                                                    com.aspose.pdf.ADocument.<init>(Unknown Source:46)
                                                                                                    com.aspose.pdf.Document.<init>(Unknown Source:4)
                                                                                                    com.lyki.easyapp.MainActivity.lambda$onCreate$1$com-lyki-easyapp-MainActivity(MainActivity.java:152)
                                                                                                    com.lyki.easyapp.MainActivity$$ExternalSyntheticLambda1.onClick(Unknown Source:2)
                                                                                                    android.view.View.performClick(View.java:7448)
                                                                                                    android.view.View.performClickInternal(View.java:7425)
                                                                                                    android.view.View.access$3600(View.java:810)
                                                                                                    android.view.View$PerformClick.run(View.java:28305)
                                                                                                    android.os.Handler.handleCallback(Handler.java:938)
                                                                                                    android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    android.os.Looper.loop(Looper.java:223)
                                                                                                    android.app.ActivityThread.main(ActivityThread.java:7656)
                                                                                                    java.lang.reflect.Method.invoke(Native Method)
                                                                                                    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                                                                                                    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
                                                                                                    	at com.aspose.pdf.ADocument.m1(Unknown Source:44)
                                                                                                    	at com.aspose.pdf.ADocument.<init>(Unknown Source:46)
                                                                                                    	at com.aspose.pdf.Document.<init>(Unknown Source:4)
                                                                                                    	at com.lyki.easyapp.MainActivity.lambda$onCreate$1$com-lyki-easyapp-MainActivity(MainActivity.java:152)
                                                                                                    	at com.lyki.easyapp.MainActivity$$ExternalSyntheticLambda1.onClick(Unknown Source:2)
                                                                                                    	at android.view.View.performClick(View.java:7448)
                                                                                                    	at android.view.View.performClickInternal(View.java:7425)
                                                                                                    	at android.view.View.access$3600(View.java:810)
                                                                                                    	at android.view.View$PerformClick.run(View.java:28305)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loop(Looper.java:223)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7656)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

+ test.html file
test.zip (1.2 KB)

+ using aspose-pdf-23.2-android.via.java.jar

Thanks,

@lykiaofficial

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFANDROID-674

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@asad.ali

Hi,
Is there any progress? I’m being hasty because I don’t think it’s normal for a conversion library to give an “unsupported” tag for the file to be converted.
Thanks.

@lykiaofficial

The ticket is still to be investigated as it is just logged in our issue tracking system. We need to further analyze the exception details and the stack trace to determine what causes such issue. We will surely look into the details and let you know as soon as the ticket is resolved. Please spare us some time.

We are sorry for the inconvenience.

你好 我也遇到同样的问题,是需要先付费才能使用吗?
Hello, I also encounter the same problem. Do I need to pay first to use it?

@yujialing

The earlier logged issue has not been yet resolved. However, you don’t have to pay in order to use/evaluate the API. You can acquire a 30-days free temporary license from our website and use it with the API. Nevertheless, we will surely inform in this forum thread as soon as we have some updates about ticket resolution. We apologize for the inconvenience.