Free Support Forum - aspose.com

Exception “Failed to Parse Base URL” when converting HTML

Hi,

I tried running the example code to convert simple HTML content to a PDF file and it works fine on my local machine.

Aspose.Html.Converters.Converter.ConvertHTML(@“Hello World!!”, “.”, new Aspose.Html.Saving.PdfSaveOptions(), “output.pdf”);

However, when I run this on a server running the app on a UNC path (e.g. \\myfilesystem\app), it throws the exception:

Failed to parse base URL: \\myfilesystem\app

StackTrace:
at ​ . [T](String , Object[] )
at ​ .(String , Object[] )
at Aspose.Html.Url…ctor(String url, String baseUrl)
at .(String , String )

Since I’m providing the content, I’m not sure why ConvertHTML is even instantiating a Url class as can be seen in the stack trace Url(url, baseUrl). Can you suggest a workaround for this?

Currently, my employer has a license for GroupDocs.Conversion and it appears the same issue affects the Converter class when trying to convert from HTML.

Thanks,
Tony

@antkov

We need to further investigate this case if order to rectify the issue. For the purpose, we have logged an investigation ticket as HTMLNET-2802 in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We apologize for the inconvenience.

@asad.ali

I’d like to add that the exact UNC path that was used contains the non-alphanumeric hyphen character (-) in case this makes a difference. E.g. \\my-file-system\my-app

@antkov

We will surely investigate the ticket as per your requirements and will let you know as soon as we have further updates in this regard. Please give us some time.

We apologize for the inconvenience.