How To Convert Pdf File Into Jpg Using Csharp
i need some solutions and sample code need
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Rahul PrasadRank #2,557 · 546 reputationPosted Sep 27, 2014, 10:13 PM EDT
using System.Drawing;
using System.Drawing.Imaging;
using Spire.Pdf;
namespace Pdf2Jpg
{
class Program
{
static void Main(string[] args)
{
PdfDocument doc = new PdfDocument();
doc.LoadFromFile("sample.pdf");
Image image = null;
for (int i = 0; i < doc.Pages.Count; i++)
{
image = doc.SaveAsImage(i);
image.Save(string.Format("img-{0}.jpg", i), ImageFormat.Jpeg);
}
}
}
}
Juha Kurittu2 reputationPosted Oct 2, 2014, 4:49 AM EDT
void PdfToJPEG(string inputPdf, string outputJpeg)
{
Leadtools.Codecs.RasterCodecs LeadCodecs = new RasterCodecs();
Leadtools.RasterImage LeadBitmap = LeadCodecs.Load(inputPdf);
LeadCodecs.Save(LeadBitmap, outputJpeg, RasterImageFormat.Jpeg411, 24);
}
The source contains more information here:
http://support.leadtools.com/CS/forums/22379/ShowPost.aspx