I have an HTML contains CSS3 styles like flexbox is not converted to PDF properly. Please see the attached zip file which contains the HTML and converted PDF
Aspose.Pdf.Drawing version: 23.8
Earlier, the same is not working with Aspose.Pdf 23.8 as well. Please help me to find the root cause.
files.zip (92.2 KB)
Did I understand correctly that now this works with Aspose.Pdf 23.8, but not with Aspose.Pdf.Drawing?
@sergei.shibanov Even with Aspose.Pdf it is not working.
@sreeraj.thottipparambil.tpr
Please provide the code fragment used
@sergei.shibanov Please see the code snippet below:
public byte[] ConvertHtmlToPdf(string htmlContent)
{
using var memoryStream = new MemoryStream();
using var htmlStream = new MemoryStream(Encoding.ASCII.GetBytes(htmlContent));
var options = new HtmlLoadOptions
{
CustomLoaderOfExternalResources = new LoadOptions.ResourceLoadingStrategy(LoadResource)
};
var document = new Document(htmlStream, options);
document.Save(memoryStream);
return memoryStream.ToArray();
}
private LoadOptions.ResourceLoadingResult LoadResource(string resourceURI)
{
byte[] contentData = GetContentFromUrl(resourceURI);
return new LoadOptions.ResourceLoadingResult(contentData);
}
private byte[] GetContentFromUrl(string url)
{
return _client.GetByteArrayAsync(url).GetAwaiter().GetResult();
}
@sreeraj.thottipparambil.tpr
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): PDFNET-55479
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.
@sergei.shibanov - As this ticket is taking time to resolve as per free support policy, can I get the list of supported CSS styles and HTML elements (or vice versa) for converting HTML to PDF using Aspose.Pdf or Aspose.Pdf.Drawing? This will help us to instruct the team to follow the same till we receive a fix.
Current version: 23.8
@sreeraj.thottipparambil.tpr
I have the following information from the development team.
We follow the specifications:
CSS - CSS current work & how to participate
HTML - https://html.spec.whatwg.org/
Thanks @sergei.shibanov
Out of these specifications, anything yet to implement as of version 23.8? We are more interested in knowing it.
@sreeraj.thottipparambil.tpr
I have no information about the development team’s plans