We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Linebreak incorrect

Lines are broken outside of A4 format border in case no spaces are found a line of text

Code:
>

private static byte[] GenPdfFromHtmlString(string htmlString, PdfModel pdfModel)
{
HtmlLoadOptions objLoadOptions = new HtmlLoadOptions
{
PageInfo =
{
IsLandscape = false,
Width = PageSize.A4.Width,
Height = PageSize.A4.Height,
Margin = new MarginInfo(40, 100, 40, 100)
},
IsEmbedFonts = true,
PageLayoutOption = HtmlPageLayoutOption.None
};
MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(htmlString));
Document pdfDocument = new Document(memoryStream, objLoadOptions);
memoryStream.Dispose();

                using (MemoryStream outputStream = new MemoryStream())
                {
                    pdfDocument.Save(outputStream, SaveFormat.Pdf);
                    return outputStream.ToArray();
                }
            }

Html:
>

    <html>
    	<head>
    		<title>htmltopdftest</title>		
    	</head>
    	<body>
    		<p>
    			Paragraph11Paragraph12Paragraph13Paragraph14Paragraph15Paragraph16Paragraph17Paragraph18Paragraph19Paragraph110Paragraph111Paragraph112Paragraph113Paragraph114
    			Paragraph21Paragraph22Paragraph23Paragraph24Paragraph25Paragraph26Paragraph27Paragraph28Paragraph29Paragraph210Paragraph211Paragraph212Paragraph213Paragraph214
    			Paragraph3Paragraph3
    			Paragraph4Paragraph1Paragraph4
    		</p>
    	</div>
    </body>
    </html>

image.png (31.8 KB)

@rutgerkoole

We have logged this problem in our issue tracking system as PDFNET-51803. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.