Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Extracting images from pdf |
Post Reply ![]() |
Author | |
Hbaloo ![]() Beginner ![]() ![]() Joined: 10 Apr 09 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() 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? |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Hbaloo ![]() Beginner ![]() ![]() Joined: 10 Apr 09 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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 ... } |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
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 Edited by Ingo - 27 Apr 09 at 11:38AM |
|
![]() |
|
Hbaloo ![]() Beginner ![]() ![]() Joined: 10 Apr 09 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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! ![]() 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? Edited by Hbaloo - 29 Apr 09 at 12:57PM |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
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 Edited by Ingo - 29 Apr 09 at 3:09PM |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store