Frequently Asked Question:
Check to see if a page in a PDF contains any images
Question
How do I check to see if a page in a PDF file contains images?
Answer
You can use the DAGetImageListCount direct access function to quickly check to see if a page in a PDF contains any images. Here is some JScript sample code:
h = QP.DAOpenFile(GetInputFolder() + "test.pdf", "");
p = QP.DAFindPage(h, 1);
imlist = QP.DAGetPageImageList(h, p);
imcnt = QP.DAGetImageListCount(h, imlist);
if (imcnt == 0)
{
MsgBox("No images")
}
else
{
MsgBox("Images!")
}