jaykappy Posted July 9, 2013 Share Posted July 9, 2013 Have been reading up on using Ghost Script to convert a multi-page PDF file into a single jpg....I ONLY want the first page of the PDF to be converted to the jpg. I was pretty confused while readying up on Ghost script and I was only getting bits and pieces of the examples... Additionally there are 4-5 version of GhostScript....(GhostPCl, GhostPDF, GhostXPS, MuPDF) wondering which one I should use OR is anyone recommends any others? Has anyone done this before? And care to show some examples.....Thanks.... Quote Link to comment Share on other sites More sharing options...
jaykappy Posted July 9, 2013 Author Share Posted July 9, 2013 I get pieces of code like this, but cant see where they are specifying the image name, output name and output location... Can anyone help? Thanks $fp_pdf = fopen($pdf, 'rb');$img = new imagick(); // [0] can be used to set page number$img->readImageFile($fp_pdf);$img->setImageFormat( "jpg" );$img->setImageCompression(imagick::COMPRESSION_JPEG);$img->setImageCompressionQuality(90);$img->setResolution(300,300);$img->setImageUnits(imagick::RESOLUTION_PIXELSPERINCH);$data = $img->getImageBlob(); Quote Link to comment Share on other sites More sharing options...
Abigail111 Posted August 20, 2013 Share Posted August 20, 2013 If you want to convert pdf to jpg.i'd like to recomment this method to you: // Method to open PDF document file in C# projectpublic static REDocument OpenDocumentFile(string filePath);public static REDocument OpenDocumentFile(string filePath, BaseDecoder dec);// Method to save PDF document to image file in C# projectpublic static void SaveImageFile(REImage image, string filePath);public static void SaveImageFile(REImage image, string filePath, BaseEncoder enc); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.