Hi -
I can convert PDFs to jpg pages but would like to convert them to PNG instead - could you advise on the process to perform this in C# please / whether it is possible in Amyuni PDF Converter?
Thanks
Convert existing PDF to PNG
Re: Convert existing PDF to PNG
Can someone from Amyuni please respond to this.
We are now looking at an alternative PDF generator to provide this functionality... and it would seem pointless to pay for two such tools going forward.
We are now looking at an alternative PDF generator to provide this functionality... and it would seem pointless to pay for two such tools going forward.
Re: Convert existing PDF to PNG
Hello,
Unfortunately our ExportToJPeg() method exports to JPEGs and not PNG.
https://www.amyuni.com/WebHelp/Amyuni_P ... Method.htm
Thanks
Unfortunately our ExportToJPeg() method exports to JPEGs and not PNG.
https://www.amyuni.com/WebHelp/Amyuni_P ... Method.htm
Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
Re: Convert existing PDF to PNG
Can i suggest that it might be a good thing to add. PNG format is much better suited as an export format for textual documents than JPG is.
Re: Convert existing PDF to PNG
Hello Stewarth
When using Amyuni PDF Creator .Net, there is alternate way of rasterizing a PDF file and saving the result as PNG. You can draw each page into a bitmap using the method IacDocument.DrawCurrentPage with the method System.Drawing.Graphics.FromImage. The code in C# should look like this:
Let us know if you have any questions about using this approach.
Best regards
Amyuni Support
When using Amyuni PDF Creator .Net, there is alternate way of rasterizing a PDF file and saving the result as PNG. You can draw each page into a bitmap using the method IacDocument.DrawCurrentPage with the method System.Drawing.Graphics.FromImage. The code in C# should look like this:
Code: Select all
FileStream myFile = new FileStream ("test.pdf", FileMode.Open, FileAccess.Read);
IacDocument doc = new IacDocument(null);
doc.Open(myFile);
doc.CurrentPage = 1;
Image img = new Bitmap(100,100);
Graphics gph = Graphics.FromImage(img);
IntPtr hdc = gph.GetHDC();
doc.DrawCurrentPage(hdc, false);
gph.ReleaseHdc( hdc );
// Then save the image as PNG
img.Save(@"c:\temp\image.png", System.Drawing.Imaging.ImageFormat.Png);
Best regards
Amyuni Support
Amyuni Development Team
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com