I have a html in which I have big image. When I convert the html to pdf using Aspose.Pdf, the image goes to next page leaving the previous page with lots of blank space. How can I make the image display without going fully to the next page. I mean by making the image use the space available in the current page and showing the rest of the part of image in the next page?
Hi Nishad,
Pdf pdf = new Pdf();<o:p></o:p>
pdf.IsLandscape = true;
pdf.ParseToPdf("c:/pdftest/Page_275.html");
pdf.Save(“c:/pdftest/COnvertedFile.pdf”);
Hi Nayyer Shahbaz
Thanks very much for the reply.
Actually the issue for me is in the below scenario.
The page has one big paragraph at the top. And below that paragraph there is an image which has a height equal to or more than the height of pdf page. Then the image is displayed in the next page even though there is some more space in the current page.
I understand that it is because there is not enough space to display the image fully in the current page, that the image is displayed in the next page. But I would like to know if there any way to show the top part of the image in the current page and the rest bottom part to next page so that there won't be any blank space left in the current page. I need to achieve it without reducing the height of the image.
Another scenario is I have an image, the height of which is more than the height of pdf page. I want to show the image without reducing the height of the image. The image needs to be displayed in 2 pages as said in the above scenario.
I have attached the image, pdf created with Aspose and aso pdf created with ExpertPdf.HtmlToPdf. I would like to create the pdf using Aspose which needs to look like the pdf created with ExpertPdf.HtmlToPdf.
Please find code Below:
private void GeneratePdf()
{
var pdf = new Aspose.Pdf.Generator.Pdf();
pdf.ParseToPdf(GetHtml());
var response = System.Web.HttpContext.Current.Response;
response.Clear();
pdf.Save("test.pdf", Aspose.Pdf.Generator.SaveType.OpenInAcrobat, response);
response.Flush();
response.End();
}
private string GetHtml()
{
return ""
+ ""
+ ""
+ ""
+ ""
+ "some text some text"
+ ""
+ "";
}
Thanks & Regards
Nishad
Please replay for <a href="?View=Flat
Hi Nishad,
Thanks
for sharing the details.
I have tested the scenario and I am able to notice the same problem. For the sake of correction, I have logged this issue as PDFNEWNET-36108 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.
The issues you have found earlier (filed as PDFNEWNET-36108) have been fixed in Aspose.Pdf for .NET 9.5.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi Nishad,