When I use Spire.pdf library and try to save page as image, the image has extra white area on top of the image.
Attached is example of pdf file and saved image, pdf file text is much closer to the top of the page while the text on the image is centered.
This happens on multiple pdf files I tried, every image has white area on top, and bottom of pdf file does not appear on image.
Can you take a look?
This is the code I am using:
- Code: Select all
PdfDocument pdfDocument = new PdfDocument(@"C:\New folder\1.pdf");
string outputFile = @"C:\New folder\1.jpg";
Stream imageStream = pdfDocument.SaveAsImage(0);
using (var fileStream = File.Create(outputFile))
{
imageStream.Seek(0, SeekOrigin.Begin);
imageStream.CopyTo(fileStream);
}
Best regards,
Filip