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 - DPLFindImages on Only One page
  FAQ FAQ  Forum Search   Register Register  Login Login

DPLFindImages on Only One page

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


Joined: 14 Mar 14
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote pinya Quote  Post ReplyReply Direct Link To This Post Topic: DPLFindImages on Only One page
    Posted: 07 Sep 14 at 12:03PM
Hello,

I need to enumerate images on only one page. How can I do it?

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 15 Sep 14 at 3:13PM

pinya,

I have modified the code sample to load only page 1 but the loop is commented out that processes all pages.

            QP.LoadFromFile("mypdf.pdf", "");
  
            //for (int p=1;p<=QP.PageCount();p++)    // Process all pages.

            int p = 1;    // Process only page 1.
            {
                QP.SelectPage(p);

                int id = QP.GetPageImageList(0);
                int count = QP.GetImageListCount(id);

                for (int i = 1; i <= count; i++)
                {
                    int type = QP.GetImageListItemIntProperty(id, i, 400);
                    int width = QP.GetImageListItemIntProperty(id, i, 401);
                    int height = QP.GetImageListItemIntProperty(id, i, 402);
                    int bpp = QP.GetImageListItemIntProperty(id, i, 403);
                    int cs = QP.GetImageListItemIntProperty(id, i, 404);
                    
                    double x1 = QP.GetImageListItemDblProperty(id, i, 501);
                    double y1 = QP.GetImageListItemDblProperty(id, i, 502);
                    double x2 = QP.GetImageListItemDblProperty(id, i, 505);
                    double y2 = QP.GetImageListItemDblProperty(id, i, 506);

                    double DPIx = width / (x2-x1) * 72.0;

                    switch (type)
                    {
                        case 1:
                            QP.SaveImageListItemDataToFile(id, i, 0, "temp_p" + p.ToString() + "i_" + i.ToString() + ".jpg");
                            break;
                        case 2:
                            QP.SaveImageListItemDataToFile(id, i, 0, "temp_p" + p.ToString() + "i_" + i.ToString() + ".bmp");
                            break;
                        case 3:
                            QP.SaveImageListItemDataToFile(id, i, 0, "temp_p" + p.ToString() + "i_" + i.ToString() + ".tif");
                            break;
                    }

                    //MessageBox.Show(type.ToString());
                }
            }

Andrew.
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