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 - image extraction questions
  FAQ FAQ  Forum Search   Register Register  Login Login

image extraction questions

 Post Reply Post Reply
Author
Message
sobisch View Drop Down
Beginner
Beginner


Joined: 29 Jan 10
Location: NRW Germany
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sobisch Quote  Post ReplyReply Direct Link To This Post Topic: image extraction questions
    Posted: 02 Feb 10 at 7:50AM

Here my little Script for extract Images of a PDF in PHP:

 
qp->LoadFromFile($path_to_pdf.'test.pdf');
$imagecount = $qp->FindImages();
if ($imagecount>0) {
 for ($image = 1; $image <= $imagecount; $image++) {
  $imageid = $qp->GetImageID($image);
  $qp->SelectImage($imageid);
  switch ($qp->ImageType()) {
   case 1: $imagetype = "jpg"; break;
   case 2: $imagetype = "bmp"; break;
   case 3: $imagetype = "tif"; break;
  }
  $qp->SaveImageToFile($path_to_pdf."image".$image.".".$imagetype);
 }
}
 
I tried this with a PDF with 2 pages, and 7 Pictures (all .bmp)
 
The Problem is, that the saved Images are partly incorrect in the Colors. All 7 images are drawings on white Background. But 4 of the saved images has reversed Colors :/ So The Background is Black and the Lines are white. So of course I can use a image library to revert the Colours of the Image, but how is it possible to find out which images have correct Colours and which does not? Of course I want save all Images of the PDF in the correct Colour ;)
 
I tried a small shell program (pdfimages.exe) to extract the Images from the same pdf. With this program, all Images have the correct Colour, so it had to be possible to get the correct Colours width QuickPDF, too?
 
And another question: On the first page of the PDF are 5 pictures, on the second page are 3 pictures. How can I extract the Page Number of the Images, or Extract only the Images of the Current Page? I need the assignment between pages and images.
Back to Top
sobisch View Drop Down
Beginner
Beginner


Joined: 29 Jan 10
Location: NRW Germany
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sobisch Quote  Post ReplyReply Direct Link To This Post Posted: 02 Feb 10 at 12:39PM
PS: the DARenderPageToFile() has the same Problem :)
 
I generate a image of each page of the PDF file. In this page-preview, the 4 images have reversed colours, too... So there are white lines on black background, the original Image (as the pdf viewer displays ist) has black lines on white background...
 
Has anyone similar problems with the Image Funktions of quickpdf?


Edited by sobisch - 02 Feb 10 at 12:39PM
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. AboutContactBlogSupportOnline Store