Hello support team,
I’m developing a feature to convert html pages to image.
The images and other resources (.css, .fonts) are hosted under authorization.
My scenario is:
- Download the html from the URL with authorization. The authorization methods may be different, for example NTLM, Basic, OAuth and etc. And this is not a problem, because I can download with the .NET WebClient and pass the required authorization.
- Pass the html to the Aspose.Html for conversion.
- Save result to the disk. The result is that no one image is visible in the converted result .jpg file.
My question: is it possible to pass authorization informaton when Aspose.Html downloads the resources (images, css) from html content? Ideally it would be great to have possibility to attach an external resource resolver with my implementation, but I’m unable to find any information about this in documentation or examples.
My code is very simple:
... MemoryStream htmlStream = GetHtmlStreamFromUrlWithAuthorization(url, accessToken); HTMLDocument htmlDocument = new HTMLDocument(htmlStream, string.Empty); var options = new ImageSaveOptions(ImageFormat.Jpeg); ... Converter.ConvertHTML(htmlDocument, options, "c:\\temp_files\\result.jpg"); ...