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!
![]() |
image extraction questions |
Post Reply
|
| Author | |
sobisch
Beginner
Joined: 29 Jan 10 Location: NRW Germany Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: image extraction questionsPosted: 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.
|
|
![]() |
|
sobisch
Beginner
Joined: 29 Jan 10 Location: NRW Germany Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
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