Answered by:
How to convert PDF to JPEG through C#

Question
-
Hello,
Can any one tell me that how to convert PDF file into JPEG Format using C#?
Thanks
Ashish Patel, MCTS Software Engineer [Level - 2]Sunday, October 3, 2010 8:58 AM
Answers
-
Hi Ashish_Patel,
The following thread is suitable for your request.
converting pdf file to an jpeg image
One solution is to use a third party library. ImageMagick is a very popular, freely available too. You can get the .NET wrapper for it by clicking the big green download button here. The original ImageMagick download page is here.
http://www.codeproject.com/KB/library/pdftoimages.aspx Convert PDF pages to image files using the Solid Framework
http://www.print-driver.com/howto/convert_pdf_to_jpeg.html Universal Document Converter
http://www.makeuseof.com/tag/6-ways-to-convert-a-pdf-file-to-a-jpg-image/ 6 Ways To Convert A PDF To A JPG Image
And you also can take a look at this thread:
how to open a page from a pdf file in pictureBox in C#
I had given a method is convert pdf to tiff first, and then retrieve the bmp from tiff.
If there’s anything unclear, please feel free to let me know.
Have a nice day!
Mike
-------------------------------------------------------------------
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to the others community members reading the thread.
*****************************************************
Sample world! You will get more from this world!
Welcome to the new world!
=================================================
Third party disclaimer
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information is found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
- Marked as answer by Mike Dos Zhang Monday, October 11, 2010 11:48 AM
Wednesday, October 6, 2010 6:22 AM
All replies
-
The one I found using Google
http://www.justskins.com/forums/converting-a-pdf-document-48037.html
Success
CorSunday, October 3, 2010 9:15 AM -
Can any one tell me that how to convert PDF file into JPEG Format using C#?
Ashish Patel, MCTS Software Engineer [Level - 2]Sunday, October 3, 2010 11:29 AM -
Search "PDF to JPEG" in this forum.
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVPSunday, October 3, 2010 2:37 PM -
Hi Ashish_Patel,
The following thread is suitable for your request.
converting pdf file to an jpeg image
One solution is to use a third party library. ImageMagick is a very popular, freely available too. You can get the .NET wrapper for it by clicking the big green download button here. The original ImageMagick download page is here.
http://www.codeproject.com/KB/library/pdftoimages.aspx Convert PDF pages to image files using the Solid Framework
http://www.print-driver.com/howto/convert_pdf_to_jpeg.html Universal Document Converter
http://www.makeuseof.com/tag/6-ways-to-convert-a-pdf-file-to-a-jpg-image/ 6 Ways To Convert A PDF To A JPG Image
And you also can take a look at this thread:
how to open a page from a pdf file in pictureBox in C#
I had given a method is convert pdf to tiff first, and then retrieve the bmp from tiff.
If there’s anything unclear, please feel free to let me know.
Have a nice day!
Mike
-------------------------------------------------------------------
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to the others community members reading the thread.
*****************************************************
Sample world! You will get more from this world!
Welcome to the new world!
=================================================
Third party disclaimer
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information is found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
- Marked as answer by Mike Dos Zhang Monday, October 11, 2010 11:48 AM
Wednesday, October 6, 2010 6:22 AM -
Hi Ashish_Patel,
You can use for this "PDF Focus .Net". Library supports PDF to Jpeg convertion succesful.
Example code for the converting from PDF file to JPEG files in C#:
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus(); f.OpenPdf(@"c:\Multipage.pdf"); if (f.PageCount > 0) { //Save all PDF pages to image folder as jpeg images, 120 dpi int result = f.ToImage(@"c:\folder with images\", "page",System.Drawing.Imaging.ImageFormat.Jpeg, 120);
- Edited by MagnetPeterson Thursday, January 12, 2012 12:26 PM
Thursday, January 12, 2012 12:25 PM -
Hi Ashish_Patel,
The following thread is suitable for your request.
converting pdf file to an jpeg image
One solution is to use a third party library. ImageMagick is a very popular, freely available too. You can get the .NET wrapper for it by clicking the big green download button here. The original ImageMagick download page is here.
http://www.codeproject.com/KB/library/pdftoimages.aspx Convert PDF pages to image files using the Solid Framework
http://www.print-driver.com/howto/convert_pdf_to_jpeg.html Universal Document Converter
http://www.makeuseof.com/tag/6-ways-to-convert-a-pdf-file-to-a-jpg-image/ 6 Ways To Convert A PDF To A JPG Image
And you also can take a look at this thread:
how to open a page from a pdf file in pictureBox in C#
I had given a method is convert pdf to tiff first, and then retrieve the bmp from tiff.
If there’s anything unclear, please feel free to let me know.
Have a nice day!
Mike
-------------------------------------------------------------------
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to the others community members reading the thread.
*****************************************************
Sample world! You will get more from this world!
Welcome to the new world!
=================================================
Third party disclaimer
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information is found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
My sister is using OXPDF software, it can quickly put the file conversion into jpeg files. bing search this software. Found it has a lot of other functions. I have a good try . Perfect convert PDF to jpeg.- Proposed as answer by Apitron LTD Thursday, June 6, 2013 12:39 PM
- Unproposed as answer by Apitron LTD Thursday, June 6, 2013 12:39 PM
Thursday, August 30, 2012 1:32 AM -
Windows 8.1 now has PDF rendering APIs and ability to save as images. Check out samples @
http://code.msdn.microsoft.com/windowsapps/PDF-viewer-sample-85a4bb30
Saturday, June 29, 2013 3:10 AM -
Hi, recently I came over a blog entry demonstrating this,
here is the code:
using Apitron.PDF.Rasterizer; using Apitron.PDF.Rasterizer.Configuration; internal class Program { private static void Main(string[] args) { // open and load the file using (FileStream fs = new FileStream(@"..\..\..\Documents\file.pdf", FileMode.Open)) { // this object represents a PDF document Document document = new Document(fs); // default rendering settings RenderingSettings settings = new RenderingSettings(); // process and save pages one by one for (int i = 0; i < document.Pages.Count; i++) { Page currentPage = document.Pages[i]; // we use original page's width and height for image as well as default rendering settings using (Bitmap bitmap = currentPage.Render((int)currentPage.Width, (int)currentPage.Height,settings)) { bitmap.Save(string.Format("{0}.png", i), ImageFormat.Png); } } // preview first rendered page Process.Start("0.png"); } } }
Tuesday, July 23, 2013 6:44 AM -
Thanks ravibh! Just what I needed.Tuesday, October 29, 2013 6:00 PM
-
It depends on which library do you want to use. If you want to use the open source control, like ghostscript https://github.com/jhabjan/Ghostscript.NET , if you want to use the third part control, you can try http://www.xspdf.com/guide/pdf-jpg-converting/ , both controls can be code in c#.net languageSunday, July 23, 2017 3:02 AM
-
You may check this one:
https://code.msdn.microsoft.com/vstudio/C-Convert-PDF-to-Image-NET-1894868f Tuesday, March 13, 2018 3:52 AM -
if you want to convert pdf to compressed jpg or convert pdf to multiple pages tiff image, you can try iditect .net pdf converter http://www.iditect.com/tutorial/pdf-to-image/Friday, June 8, 2018 3:55 AM