Hello,
I create PDF from image in various resolutions, the problem is that when I set the PDF into landscape mode the quality of the image is destroyed.
I tried it with the latest version (9.9.0) with the same result.
For example, an image with resolution 1176 (width) and 1058 (height).
The code :
var pdf = new Pdf();
pdf.CompressionLevel = 0;
pdf.IsLandscape = true;
pdf.PageSetup.Margin.Top = 0;
pdf.PageSetup.Margin.Right = 0;
pdf.PageSetup.Margin.Bottom = 0;
pdf.PageSetup.Margin.Left = 0;
foreach (var img in images)
{
if (!ImpressionControlHelper.AllOneColor((Bitmap)img))
{
var sec = pdf.Sections.Add();
//sec.IsLandscape = true;
var image = new Aspose.Pdf.Generator.Image(sec);
sec.Paragraphs.Add(image);
image.ImageInfo.ImageStream = new MemoryStream(ImpressionControlHelper.ImageToByteArray(img));
image.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Bmp;
}
}
return pdf.GetBuffer();
Thank you for your help !