Free Support Forum -

Large image getting cropped with HTML to PDF conversion (2.3 MB)
I am trying to convert HTML to PDF and I am having large image within my HTML

Image is getting cropped out from the very first page and rest image is shown in rest of the page
I am attaching sample HTML, image and output PDF file with following code snippet

var objMemoryStream = new MemoryStream();
var writer = new StreamWriter(objMemoryStream);
writer.Write("<html><head></head><body><img src=\"\" width=\"1200\"/></body></html>");

HtmlLoadOptions objHtmlLoadOptions = new HtmlLoadOptions("styles/assets/");
PageSize.A4.IsLandscape = true;

using (Document objPDFDocument = new Document(objMemoryStream, objHtmlLoadOptions))


Please try to use below property to render the image on single page inside PDF:

objHtmlLoadOptions.IsRenderToSinglePage = true;

output.pdf (2.8 MB)