How To Convert Pdf File Into Jpg Using Csharp
i need some solutions and sample code need
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Juha KurittuPosted Oct 2, 2014, 8:49 AM
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
Rahul PrasadPosted Sep 28, 2014, 2:13 AM
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);
}
}
}
}