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 - How to determine if page is blank?
  FAQ FAQ  Forum Search   Register Register  Login Login

How to determine if page is blank?

 Post Reply Post Reply
Author
Message
JanN View Drop Down
Senior Member
Senior Member


Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 116
Post Options Post Options   Thanks (0) Thanks(0)   Quote JanN Quote  Post ReplyReply Direct Link To This Post Topic: How to determine if page is blank?
    Posted: 23 Nov 07 at 10:44AM
Hi!

I need to check if a page of an existing pdf file is completely blank. Well, of cource I can check the page text. But how about images? The function ImageCount is not applicable.

Any ideas? I already thought about using the GetPageContent function. But my knowledge about the structure is very limited.

Any help is greatly appreciated.

Regards
Jan
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: 23 Nov 07 at 5:10PM
Hi Jan!

I do it this way ...

With this code i read the pdf-content into a string:

   textkomplett := '';
   fs := TFileStream.Create(Edit1.Text,fmOpenRead+fmShareDenyWrite);
   try
     SetLength(textkomplett,fs.Size);
     fs.Read(PChar(textkomplett)^,fs.Size);
   finally
     fs.Free;
   end;

If i'm searching for images inside the content must be the tag "/Image":

    If Pos('/Image', textkomplett) > 0 Then
       mibi.Text := 'Yes'
      Else
       mibi.Text := 'No';

Best regards,
Ingo

Back to Top
JanN View Drop Down
Senior Member
Senior Member


Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 116
Post Options Post Options   Thanks (0) Thanks(0)   Quote JanN Quote  Post ReplyReply Direct Link To This Post Posted: 24 Nov 07 at 9:52AM
Hi Ingo!

Thanks for your reply.

But the way you do it only tells me if there are any images in the pdf file. So far so well. But I need to know if one of the images is used for one specific page.

Perhaps this is possible by getting the object numbers of the images and check if they are referenced to in the page.


Edited by JanN - 24 Nov 07 at 9:54AM
Back to Top
JanN View Drop Down
Senior Member
Senior Member


Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 116
Post Options Post Options   Thanks (0) Thanks(0)   Quote JanN Quote  Post ReplyReply Direct Link To This Post Posted: 05 Dec 07 at 8:03AM
One last try.

I haven't been successful, yet. My knowledge of the pdf structure is not sufficient for solving this problem.

Does anyone have another idea or perhaps a piece of code Wink?

Best regards,
Jan
Back to Top
krom View Drop Down
Beginner
Beginner


Joined: 20 Sep 07
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote krom Quote  Post ReplyReply Direct Link To This Post Posted: 06 Dec 07 at 9:27AM
h:=QP.DAOpenFile(filename);
p:=QP.DAFindPage(h,pagenum);
imlist:=QP.DAGetPageImageList(h,p);
imcnt:=QP.DAGetImageListCount(h,imlist);
if imcnt=0 then 'No images'
Back to Top
JanN View Drop Down
Senior Member
Senior Member


Joined: 29 Oct 05
Location: Germany
Status: Offline
Points: 116
Post Options Post Options   Thanks (0) Thanks(0)   Quote JanN Quote  Post ReplyReply Direct Link To This Post Posted: 06 Dec 07 at 10:06AM
Thanks for that reply. Once again a surprise what the DA-functions are able to do.

Best regards,
Jan
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