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!
How to determine if page is blank? |
Post Reply |
Author | |
JanN
Senior Member Joined: 29 Oct 05 Location: Germany Status: Offline Points: 116 |
Post Options
Thanks(0)
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
JanN
Senior Member Joined: 29 Oct 05 Location: Germany Status: Offline Points: 116 |
Post Options
Thanks(0)
|
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 |
|
JanN
Senior Member Joined: 29 Oct 05 Location: Germany Status: Offline Points: 116 |
Post Options
Thanks(0)
|
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 ? Best regards, Jan |
|
krom
Beginner Joined: 20 Sep 07 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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'
|
|
JanN
Senior Member Joined: 29 Oct 05 Location: Germany Status: Offline Points: 116 |
Post Options
Thanks(0)
|
Thanks for that reply. Once again a surprise what the DA-functions are able to do.
Best regards, Jan |
|
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