<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>> > I don't know of a good way to validate the page</div><div>> > count. Even going through the page tree might be hard to do right without</div><div>> > leading to an infinite loop, in addition to being slow.</div><div>> </div><div>> Catalog::cachePageTree goes over the tree, but i agree doing that to calculate <span style="font-size: 12pt;">the num of pages can be meh.</span></div><div><br></div><div><br></div><div>If the number of pages is huge, the PDF might be intentionally corrupted to provoke a bug in a particular PDF viewer, and other data structures could be subtly corrupted as well. Any scan would have to proceed very cautiously.</div><div><br></div><div><br></div><div>If there is a minimum number of objects required for a page, and if the total number of objects is easy to find, could poppler immediately reject files with (total num objects) / (min objects per page) < page count?</div><div><br></div><div><br></div><div>William</div><div><br></div><div><br></div>                                    </div></body>
</html>