From:             r dot staribacher at hypermove dot com
Operating system: windows 2000/xp
PHP version:      4.3.2
PHP Bug Type:     Zlib Related
Bug description:  gzuncompress problem

Description:
------------
error occured on:
OS: windows 2000 and xp
webserver: apache and iis

I am using a PHP class for reading pdf files. this class uses gzuncompress
which causes problems on windows. IE displays the message "action
canceled". Under Linux it "seems" to work. Parsing a large amount of pdf
files also causes the process to stop.
I have seen the Bug #20535: zLib crashes when trying to gzuncompress. So I
tried to solve the problem using the optional length parameter. That
didn't solve the problem.

you can see or download the class on:
http://www.phpclasses.org/browse.html/package/702.html 

I tried also xpdf (pdftotext.exe) to read PDFs using exec(), but another
problem (unable to fork ...) occured! But this is not part of my bug
report, but also annoying.

One question:
We can create PDFs using PHP! Why can't we read PDFs using PHP? It should
be easier reading them instead of creating them?

php.ini settings:
savemode = off
magic quotes = off
no additional modules are activated (gzip is already compiled into php
4.3)

Reproduce code:
---------------
  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,1);
      $this->_buffer = $stream . substr($this->_buffer, $endpos + 9);
    }    
    return $line;
  }

Expected result:
----------------
The code will return an integer (how many times is the search expression
in the pdf document). 
The original class returns true (found search expression) othewise false I
think!



-- 
Edit bug report at http://bugs.php.net/?id=25224&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25224&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25224&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25224&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25224&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25224&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25224&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25224&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25224&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25224&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25224&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25224&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25224&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25224&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25224&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25224&r=gnused

Reply via email to