Page 1 of 1
pdf & php
Posted: Wed Jul 12, 2006 12:50 pm
by csfolch
Hi.
I'm trying to search text inside a pdf document using PHP. Looking in php.net documentation i found a useful code, but now i need to know the page where the text searched is.
Do you know how pdf represents the "end of page"?
Thanks.
Posted: Wed Jul 12, 2006 4:23 pm
by andym01480
Not that simply. It is not like one page of data, end of page marker, next page of data. It seems to be more complicated than that using page trees etc so that very large docs can be opened with out the whole file being read....
The manual for how it works is a 6.9MB download at
http://partners.adobe.com/public/develo ... ence16.pdf
Page 118 refers to some of how the tree works and would show some sort of marker
Code: Select all
2 0 obj
<< /Type /Pages
/Kids [ 4 0 R
10 0 R
24 0 R
]
/Count 3
>>
endobj
4 0 obj
<< /Type /Page
…Additional entries describing the attributes of this page…
>>
endobj
From what I can see the numbers and letters are pointers to data streams. I haven't read all of the manual -its 1236 pages, but someone else may have and can help more usefully. Or download it for some light bedtime reading (a cure for insomnia definitely!!!!)