PdfDocumentView pdfDoc = new PdfDocumentView();
pdfDoc.Model = new PdfViewerModel();
var docStream = new FileStream("test.pdf", FileMode.Open);
pdfDoc.Model.LoadedDocument = new PdfLoadedDocument(docStream);
Bitmap img = pdfDoc.Model.LoadedDocument.ExportAsImage(0, new SizeF(2550, 3300), 300, 300, false);
img.Save("test.png", ImageFormat.Png);
While the pdf does get converted to high resolution image (png), it does not respect the transparency of objects in the original PDF file.
I have attached the samples from my test. Am I missing a setting or some other property? Also, my use of the "model" seems a little hacky, but it was the only way I could get it to work.
Query |
Details |
I'm looking here: https://help.syncfusion.com/file-formats/pdf/working-with-document-conversions#converting-pdf-to-image
and see the sample, but not able to add or find the PdfViewer to my project.json, am I missing something? |
We do not support PDF viewer control in the ASP.NET Core platform. However, we have added this request to our features request list and it can be available in any of our upcoming releases. |
I think I may now see the limitation...
If I am now understanding things correctly, the Syncfusion for ASP.NET Core does "not" have the PdfViewer library (Syncfusion.PdfViewer.Windows.dll), so that feature is not available. (?)
Is that feature available in the ASP.NET MVC version? | |
While the pdf does get converted to high resolution image (png), it does not respect the transparency of objects in the original PDF file.
I have attached the samples from my test. Am I missing a setting or some other property? Also, my use of the "model" seems a little hacky, but it was the only way I could get it to work.
Attachment: Syncfusion_test_01_57de749f.7z |
We have created an incident under your account for the queries in your last update. We request you to follow the incident for further updates. You can log in to our support system using the following link,
|
Is there an update on the ability to convert PDF to an Image in an .NET Core application please?
Hi Stefan,
Thank you for contacting Syncfusion support.
We have created new incident under your account regarding the support for “Converting the PDF document pages to images in .NET Core”. Please log on to our support website to check for further updates.
Please let us know if you have any concern on this.
Regards,Akshaya
Hi Effy,
The support
for “Converting PDF document pages to images in ASP.NET Core platform” was
added to our 2018 Vol 4 release. This release is available for download under
the following link.
Documentation
link on how to convert the PDF pages in ASP.NET Core: https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/how-to/export-as-image/
We thank you
for your support and appreciate your patience in waiting for this release.
Please get in touch with us if you would require any further assistance.
Thanks,
Meikandan