I have downloaded FreeSpire 6.2.0 via nuget packages to convert a pdf file's 1st page to an image.
My application is a .net core 3.1 razor pages app. It is working perfectly on windows10 on local machine. But when I deployed app to azure server which is a linux server the created image is a defective image and it's size is much bigger(349,2KB) than the size of image(164,6) created on local machine of the same pdf file.
Is there a way to prevent it.
My Code is:
- Code: Select all
IFormFile file = Request.Form.Files[0];
PdfDocument doc = new PdfDocument();
doc.LoadFromStream(file.OpenReadStream());
Image bmp = doc.SaveAsImage(0);
Stream msThumbnail = new MemoryStream();
bmp.Save(msThumbnail, ImageFormat.Png);
msThumbnail.Position = 0;
await blob.UploadToAzureBlob(fileNameGuid + "_thumbnail.png", msThumbnail);
images of locally created, and server created are attached.
Thanks for the help.
Sati