Print Page | Close Window

Extracting images from pdf

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1069
Printed Date: 22 May 25 at 1:44PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Extracting images from pdf
Posted By: Hbaloo
Subject: Extracting images from pdf
Date Posted: 26 Apr 09 at 1:55PM
Hy,
I have a pdf file,where every page is an image.I'm having trouble saving these images on-by-one to my hard disk. I tried getting the id of the img, selecting by id then saving it, averythin looks great, return values are OK, but  the saved picture is black page.Can you help me Please?



Replies:
Posted By: Ingo
Date Posted: 26 Apr 09 at 3:28PM
Hi!
Which function you're using? Which is the imagetype? With SaveImageToFile only jpg, bmp and tiff are okay. You can test before the type with ImageType.
Cheers, Ingo


Posted By: Hbaloo
Date Posted: 27 Apr 09 at 10:40AM
I use FindImages to make sure program detects the pictures, it gives me the correct number(for example this will be x).I use getimageID to get the id of pictures numbered 1 to x.(it seemes that it could get the id of the pictures, it's a quite long number as i rembeber).when i get an ID i use SelectImag, the return value is 1 indicating it's correct.Then i call ImageType, which tells me it's a bmp, which i would like to use in the future so it's perfect.Then comes SaveImagetoFile.It returns 1 , so it should be okay, but it's still just a black page. Here's my code for better understanding(altough it's a bit messy):
 MentMappa = "C:\\";
 for (int i = 0; i < konyvtar.QuickPDFPageCount(ID); i++)//every page consists of 1 picture,FindImages gives me the number of the images which is equal to the pagenukber so it's correct
                {
                    int kepszam = konyvtar.QuickPDFFindImages(ID);
                    Kepetment = MentMappa + "tmpkep"+(i + 1) + ".bmp";
                    int imgid = konyvtar.QuickPDFGetImageID(ID, i + 1);
                    int kepv = konyvtar.QuickPDFSelectImage(ID, imgid);
                    int keptipus = konyvtar.QuickPDFImageType(ID);
                    int sikeresmentes=konyvtar.QuickPDFSaveImageToFile(ID, Kepetment);
                   //Esetleg a képbol kivagom amegfelol reszt
                    BeKep = new Bitmap(Kepetment);
                   // and so on ...
}


Posted By: Ingo
Date Posted: 27 Apr 09 at 11:37AM
Hi!

As far as i know there isn't a documented function for complete imageextraction. The functions have only affect to the images you've inserted yourself before.

Cheers, Ingo


Posted By: Hbaloo
Date Posted: 29 Apr 09 at 12:48PM
Is there a way to convert a pdf to a bmp ? If so, how?
What is the diffrence between saving an img in the pdf to file if i put it there in the program, or i loaded the pdf and the picture was included?
Thanks for help!Thumbs%20Up
edit:i don't really need it to save on the disk, but i have to use it in a Bitmap format, maybe it's possible to create a Bitmap variable from the selected image in the document?


Posted By: Ingo
Date Posted: 29 Apr 09 at 3:06PM
Hi!

You can read all about this case in the online-documentation at:
http://www.quickpdflibrary.com/help/quickpdf/FunctionGroups.php
in section:
"Rendering and printing"
for your job you can take the functions:
"RenderDocumentToFile" and
"RenderPageToFile".
If you don't want to write on disc you can use better
"RenderPageToStream" to go on working with the content.

Cheers, Ingo





Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk