Hello,
I have an application that creates pdfs with background images and adds in text dynamically. When generating the PDF everything looks as it should, but when we SaveAsImage in the cases of large pdfs/images the background becomes pixelated.
For example:
Source image: chapterweb.net/test-source.jpg
Spire.PDF Ouput PDF: chapterweb.net/test.pdf
Spire.PDF SaveAsImage Output: chapterweb.net/test-output.jpg
The snip of code that converts the pdf to image is the following:
using (System.IO.MemoryStream mem = new System.IO.MemoryStream())
{
using (Image img = doc.SaveAsImage(0, Spire.Pdf.Graphics.PdfImageType.Bitmap, 150, 150)
{
doc.Close();
img.Save(mem, System.Drawing.Imaging.ImageFormat.Jpeg);
}
mem.Position = 0;
return mem.ToArray();
}
Currently using Spire.PDF version 3.8.22 with a license.
Thank you.