I can determine if there is any text on a page, but do not know how to determine if there are any images on a page. I would like to be able to determine if the page is just a blank page and doesn't have any text or images. How do I determine if there are images on a page.
Thank you.
Way to determine if page is empty
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Way to determine if page is empty
Hi, tdonovan.
It is too difficult to say that page is blank or not... In common case you must have exact feedback info from pdf-renderer - something was painted or not.
Еven in this case, you are not protected from trouble - page can have a simple white rectangle and the pdf-renderer will say: "the visible content exists and was painted"..
I think you must rasterize the page and when result-image isn't a simple white rectangle - then page isn't blank... Or more correct way - rasterize page with "fully transparent background" option, and when result-image is still fully transparent - then page is actually blank.
HTH.
It is too difficult to say that page is blank or not... In common case you must have exact feedback info from pdf-renderer - something was painted or not.
Еven in this case, you are not protected from trouble - page can have a simple white rectangle and the pdf-renderer will say: "the visible content exists and was painted"..
I think you must rasterize the page and when result-image isn't a simple white rectangle - then page isn't blank... Or more correct way - rasterize page with "fully transparent background" option, and when result-image is still fully transparent - then page is actually blank.
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 61
- Joined: Tue Jun 12, 2007 9:21 pm
Re: Way to determine if page is empty
Maybe someday in the future you could add a feature to allow us to determine this. I understand exactly what you are saying and will work on implementing. Just thinking maybe the viewer could determine this without having to generate the image and examine the image. Thanks.