|
/**********************************************************************
**
** A class to search text in pdf documents.
** Not pretending to be useful other than that.
** But it can easily be extended to a full featured pdf document
** parser by anyone who chooses so.
**
** Author: Rene Kluwen / Chimit Software
**
** License: Public Domain
** Warranty: None
**
***********************************************************************/
class pdf {
// Just one private variable.
// It holds the document.
var $_buffer;
var $_filename;
// Constructor. Takes the pdf document as only parameter
function pdf($file) {
$this->_filename = $file;
if(file_exists($this->_filename)){
$fp = fopen($this->_filename, "r");
$content = fread($fp, filesize($this->_filename));
fclose($fp);
$this->_buffer = $content;
}else{
echo "Error: File not found!";
}
}
// 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 (preg_match("/stream/", $line)) {
echo "stream found and counted for...";
$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;
}
// This function returns the next line in the document that is printable text.
// We need it so we can search in just that portion.
function textline() {
$line = $this->nextline();
if ($line === false) {
return false;
}
if (preg_match("/[^\\\\]\\((.+)[^\\\\]\\)/", $line, $match)) {
$line = preg_replace("/\\\\(\d+)/e", "chr(0\\1);", $match[1]);
return stripslashes($line);
}
$this->textline();
}
function pdf2text() {
$filecontent = ""; // String datatype container for the found text...
// the file has the extension '.pdf' and needs to be 'txt'...
$filename = ereg_replace("(.*)\.([^\.]*)$", "\\1", $this->_filename).".txt";
while (($line = $this->nextline()) !== false) {
$filecontent .= $line."\n";
}
if ($fp = fopen("$filename", "w+")) {
fputs($fp, $filecontent, strlen($filecontent));
fclose ($fp);
return true;
}
}
// This function returns true or false, indicating whether the document contains
// the text that is passed in $str.
function textfound($str) {
while (($line = $this->textline()) !== false) {
if (preg_match("/$str/i", $line) != 0) {
return true;
}
}
return false;
}
}
?>
Gal�ria |
|
|
Sztárportré
ZenĂ©szek, szĂnĂ©szek, Ă©nekesek Ă©s bulvárszereplõk minden hĂ©ten a WebrádiĂłn, a SztárportrĂ©ban.
|
Gal�ri�k: 10 gal�ria tal�lhat� |
Kicsi Dope -alias Pityinger Péter Dopemann kisöcse szerzi a zenéket, gitározik, most pedig a lányokról nyilatkozik. |
Ihos József humorista Ihos József humorista a szabaságról, a sorsról és Kató nénirõl beszél | |
Mester Tamás A SztárportrĂ© beszĂ©lgetõtársa Mester Tamás, akinek segĂtsĂ©gĂ©vel egy kĂ©pzeletbeli boldog ember kĂ©pĂ©t prĂłbálják megfesteni |
Lola A Sztárportré eddigi legfiatalabb vendége Lola beszél a boldogságról és a Nagy Õ-rõl. | |
Vincze Lilla Vincze Lilla vall a hûségrõl és a zene varázslatosságáról a Sztárportréban. |
Varga Zsuzsa Boldog ember Varga Zsuzsa, de nem árt tisztában lenni az elvarratlan szálakkal -valljaa Sztárportéban az énekes. | |
Portré a boldog emberrõl Összegzõ portrénkban Vincze Lilla, Varga Zsuzsa, Lola, Demjén Ferenc, Ihos József, Erdei Sándor és Mester Tamás vall a boldogságról. |
Sebeõk János Hûséges és állhatatos ember Sebeõk János a szerelemben, de szerinte el kell fogadnunk a bennünk rejlõ vadállatot. | |
Kémeri Péter Sebõk Anikó (C'est la vie, Jeta) võlegénye barátnõje tragikus halála után közösen felvett dalaik megjelentetésére készül. |
Tóth Gabi A megasztár Tóth Gabi szerint egyszerre nem lehet két emberbe szerelmesnek lenni. |
|