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

Free Support Forum - aspose.com

Getting an error reading an html file into a Document object using PDF for Java

The exception seems thrown when the following code is called:

com.aspose.pdf.Document document = new com.aspose.pdf.Document(htmlPageFileName, htmloptions);

Exception in thread “java.lang.ThreadGroup[name=main,maxpri=10]_4” java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1367)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at com.aspose.pdf.internal.l57k.l2u.lI(Unknown Source)
at com.aspose.pdf.internal.l57k.l2u.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lu.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.lf(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.lj(Unknown Source)
at com.aspose.pdf.internal.html.HTMLImageElement$2.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lt.lk(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.lu(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.lI(Unknown Source)
at com.aspose.pdf.internal.l38v.ly$2.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lt$1.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lt.lk(Unknown Source)
at com.aspose.pdf.internal.l33t.lu.lf(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.lI(Unknown Source)
at com.aspose.pdf.internal.l38v.ly.lI(Unknown Source)
at com.aspose.pdf.internal.html.dom.Document$lf$1$1.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lt.lk(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.ld(Unknown Source)
at com.aspose.pdf.internal.l33t.lb.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lb$1.lI(Unknown Source)
at com.aspose.pdf.internal.l33t.lf$lI$1.lI(Unknown Source)
at com.aspose.pdf.internal.l57k.l1j.lI(Unknown Source)
at com.aspose.pdf.internal.l57k.l1n.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)

The html file contains such image tags.
SyntaxEditor Code Snippet

@wshen,

Can you please attach the source HTML in a zip file, please?

items2.zip (204.6 KB)

@wshen,

I was getting some strange behavior with this Html document so I did several tests, including doing the conversion using the C# version of Aspose.Pdf, which worked out but took an unusual amount of time.

Then in Java did not work. So I will be creating a ticket for the Dev team now…

@wshen
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): PDFJAVA-42544

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.