how to search in pdf files using php predefined classes?
Posted: Tue Jan 15, 2008 6:49 am
hi,
I have no idea how to search in pdf files have you any idea or suggestion or even function that can help me doing so?
please leave me a simple sample codes to understand?
is there any better way to do so?
I have no idea how to search in pdf files have you any idea or suggestion or even function that can help me doing so?
please leave me a simple sample codes to understand?
Code: Select all
function pdf_search($buffer) {
$this->_buffer = $buffer;
}
// This function returns the next line from the document. If a stream follows, it is deflated into readable text.
function nextline() {
$pos = strpos($this->_buffer, "\r");
if ($pos === false) {
return false;
}
$line = substr($this->_buffer, 0, $pos);
$this->_buffer = substr($this->_buffer, $pos + 1);
if ($line == "stream") {
$endpos = strpos($this->_buffer, "endstream");
$stream = substr($this->_buffer, 1, $endpos - 1);
$stream = @gzuncompress($stream);
$this->_buffer = $stream . substr($this->_buffer, $endpos + 9);
}
return $line;
}