Using C#, I need to convert each page of a PDF file into separate images and display the images.
Is it possible to do this without using a 3rd party DLL?
To show PDF into DLL, you simply have to add a sample, alter it, if required, and save all modifications. The uploading strategies are vast and contain searching a file from the unit, importing it from your cloud, by way of a secure URL, e-mail request, or obtaining a template in the pdfFiller's kind library.
You can also use a c# code that is easly downloadable from Code Project that use Ghostscript
http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx
Not a huge job, as it has already been done :)
you'll need ghostscript installed (mainly gsdll32.dll), and the c# wrapper from http://redmanscave.blogspot.com/
It's one .cs file. For some reason you'll have to email him for the file, it is not posted.
To convert you'll just a few lines, for example:
string cl2 = @"-dSAFER -dNoVerifyXref -dQUIET -dNOPROMPT"
+ " -dBATCH -dNOPAUSE -sDEVICE=jpeg -r72 -dFirstPage=1 "
+ "-dLastPage=1 -dUseCropBox -sOutputFile=" + SourceFile
+ " " + TargetFile;
try
{
Made4Print.GhostScript gs =
new Made4Print.GhostScript(@"[path-to-gs-installation]");
gs.CallGSDll(cl2.Split(' '));
}
catch
{
//exception handler
}
this saves 1st page as jpeg @ 72 dpi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With