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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Extracting images from pdf
  FAQ FAQ  Forum Search   Register Register  Login Login

Extracting images from pdf

 Post Reply Post Reply
Author
Message
Hbaloo View Drop Down
Beginner
Beginner
Avatar

Joined: 10 Apr 09
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hbaloo Quote  Post ReplyReply Direct Link To This Post Topic: Extracting images from pdf
    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?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Hbaloo View Drop Down
Beginner
Beginner
Avatar

Joined: 10 Apr 09
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hbaloo Quote  Post ReplyReply Direct Link To This Post 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 ...
}
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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


Edited by Ingo - 27 Apr 09 at 11:38AM
Back to Top
Hbaloo View Drop Down
Beginner
Beginner
Avatar

Joined: 10 Apr 09
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hbaloo Quote  Post ReplyReply Direct Link To This Post 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?


Edited by Hbaloo - 29 Apr 09 at 12:57PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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




Edited by Ingo - 29 Apr 09 at 3:09PM
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store