I am converting a HTML file to PDF. But the borders are different for some rows.
It seems that the styling of the borders isn’t always taken over properly. See the attached files for an example.
This is the HTML:
image.png (1.4 KB)
This is the PDF:
image.png (826 Bytes)
Result.zip (28.7 KB)
@jonkeda
Can you please share which code snippet are you using for the conversion? We will further proceed accordingly to address the issue.
This is the code snippet that we use.
Kind regards, Daan
internal static byte[] ConvertHtmlToPdfByteArray(string htmlData, PageSize pageSize)
{
byte[] byteArray = Array.Empty<byte>();
var pageWidth = ConvertMmToPixels(pageSize.PageWidthMm);
var pageHeight = ConvertMmToPixels(pageSize.PageHeightMm);
using (var document = new HTMLDocument(htmlData, string.Empty))
{
// Initialize PdfSaveOptions
var pdfOptions = new Aspose.Html.Saving.PdfSaveOptions();
//Set Page Margins
pdfOptions.PageSetup.AnyPage = new Aspose.Html.Drawing.Page(
new Aspose.Html.Drawing.Size(pageWidth, pageHeight),
new Aspose.Html.Drawing.Margin(0, 0, 0, 0));
// Create MemoryStream to hold PDF document
using (var pdfStreamProvider = new MemoryStreamProvider())
{
Converter.ConvertHTML(document, pdfOptions, pdfStreamProvider);
if (pdfStreamProvider.Streams.Any())
{
var memoryStream = pdfStreamProvider.Streams.First();
memoryStream.Seek(0, SeekOrigin.Begin);
byteArray = memoryStream.ToArray();
}
}
}
return byteArray;
}
@jonkeda
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): HTMLNET-5851
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.