Bug Found in HTML to PDF - <br> is not liked when using CSS Margins

I have found out there seems to be a bug (.net) when outputting text to the PDF with a margin.


When using the margin-left in the CSS for example:

p.subheader2
{
font-family: Calibri;
font-size: 12pt;
text-align: left;
margin-left: 40px;
}

My Road, Manchester, My Postcode


Everything seems to be work fine, however as soon as you start using
or for new lines then the margins don’t work (but it works in web browsers). For example:

p.subheader2
{
font-family: Calibri;
font-size: 12pt;
text-align: left;
margin-left: 40px;
}


My Road,
Manchester,
My Postcode


At the moment I can sort of work around it by closing the p tag and putting the
after it but it is a pain having declare a new

tag for every new line.

Hi William,


Thanks for your inquiry. I’ve tested the scenario with latest version of Aspose.Pdf for .NET, I manged to observe line break tag issue with left margin settings and logged it as PDFNEWNET-35844 in our issue tracking system for further investigation and resolution. We will notify you via this forum thread as soon its resolved.

We are sorry for the inconvenience caused.

Best Regards,

Hi and thank-you for looking into this.

After working with this version I think there is however an even bigger problem with the tag
.

It seems that the
also affects most styling as a whole for e.g:






Both images should be centered but they are not. The first image is centered but the second one isn’t.

Kind Regards,
William

Hi William,


Thanks for your feedback. I’m afraid I’m unable to found image styling issue with line break tag, both images are rendered in center. Can you please confirm your Aspose.Pdf for .NET API version and also share input/output documents? So we will investigate the issue and will provide you information accordingly.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-35844) have been fixed in Aspose.Pdf for .NET 9.5.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi William,


Thanks for your patience. Your reported issue has been fixed in new DOM approach of HTML to PDF conversion. Please check following documentation link for details and code snippet.


Please feel free to contact us for any further assistance.

Best Regards,