HTML to PDF conversion issue in Java

I am trying to convert HTML to pdf using groupdocs.convert

Version used

com.groupdocs
groupdocs-conversion
19.10

Error : com.groupdocs.conversion.internal.c.a.pd.internal.l31n.lt: Failed to parse URL.
at com.groupdocs.conversion.internal.c.a.pd.internal.l31h.lI.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.Url.(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.net.UrlResolver.resolve(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l29h.lt.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l29h.lt.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l29h.ld.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l31u.lf.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.HTMLLinkElement$1.doj(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.HTMLLinkElement$1.invoke(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l26u.l1k.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.HTMLLinkElement.getSheet(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.collections.lh$lI.acceptNode(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.dom.traversal.lf.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.dom.traversal.lj.nextNode(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.collections.lb.hasNext(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.collections.lj$lI.hasNext(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.collections.lh.(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.HTMLDocument.getStyleSheets(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l29h.ld.lt(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l29h.ld.lu(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l31u.lf.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l37h.ld.a(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.l37h.ld.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.internal.html.rendering.HtmlRenderer.render(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.l6v.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.l6v.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.ADocument.lI(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.ADocument.(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.internal.c.a.pd.Document.(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.domain.documents.PdfDocument.c(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.domain.documents.PdfDocument.a(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.domain.DocumentBase.load(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.domain.DocumentLoader.a(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.domain.DocumentLoader.load(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.handler.ConversionHandler.convert(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]
at com.groupdocs.conversion.handler.ConversionHandler.convert(Unknown Source) ~[groupdocs-conversion-19.10.jar:19.10]

On windows 7 using Eclipse

Code :
ConversionConfig conversionConfig = getConversionConfig();
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
PdfSaveOptions pdfsaveOption = new PdfSaveOptions();
pdfsaveOption.getPdfOptions().getFormatingOptions().setPageMode(PdfFormattingOptions.PdfPageMode.UseNone);
convertedDocumentPath = conversionHandler.convert(inputfile, pdfsaveOption);
convertedDocumentPath.save(outputFile.getName());

bootstrap.zip (3.8 KB)
Please check attached zip input html file

1 Like

@swapnilkumbhar,

This issue is reproduced at our end. Hence it has been logged in our internal issue tracking system with ID : CONVERSIONJAVA-855. This is now under investigation. As there is any update, you’ll be notified.

@swapnilkumbhar
We cannot reproduce this issue CONVERSIONJAVA-1597 using API version 23.11.