Print Page | Close Window

image extraction

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=1692
Printed Date: 14 Jun 25 at 10:17PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: image extraction
Posted By: snelldl
Subject: image extraction
Date Posted: 23 Dec 10 at 8:03PM
I am trying to pull images from this pdf: http://www.4dwebdesign.com/uploads/5238.pdf
As you can see, there is at least one image on the first page. However, the following code says there are no images on the first page:
 
int[] intImageTypes = new int[4];
                                                int intFileHandle = qp.DAOpenFile(strTempTargetPath + "/" + e.FileName, "");
                                                int intTotalPages = qp.DAGetPageCount(intFileHandle);
                                                for (int k = 0; k <= intTotalPages; k++)
                                                {
                                                    int intPageHandle = qp.DAFindPage(intFileHandle, k);
                                                    int intImageList = qp.DAGetPageImageList(intFileHandle, intPageHandle);
                                                    int intImageCount = qp.DAGetImageListCount(intFileHandle, intImageList);
                                                    for (int i = 0; i < intImageCount; i++)
                                                    {
                                                        int intImageType = qp.DAGetImageIntProperty(intFileHandle, intImageList, i, 400);
                                                        int intImageWidth = qp.DAGetImageIntProperty(intFileHandle, intImageList, i, 401);

                                                        int intImageHeight = qp.DAGetImageIntProperty(intFileHandle, intImageList, i, 402);
                                                        double intImageLeft = qp.DAGetImageDblProperty(intFileHandle, intImageList, i, 501);
                                                        double intImageRight = qp.DAGetImageDblProperty(intFileHandle, intImageList, i, 503);
                                                        double intImageTop = qp.DAGetImageDblProperty(intFileHandle, intImageList, i, 502);
                                                        double intImageBottom = qp.DAGetImageDblProperty(intFileHandle, intImageList, i, 508);
                                                        intImageTypes[intImageType] += 1;
                                                    }
                                                }



Replies:
Posted By: snelldl
Date Posted: 23 Dec 10 at 8:22PM
Never mind - read the documentation on DAFindPage and saw that they are one based, not zero based.



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