Hi,

this time I encountered another problem.
(my setup: Tomcat 5.5, itext 5.0.0)

i wrote a servlet that, using itext, extracts 1 page of a source pdf
from directory A file and writes this 1 page as temporary pdf-file into
another directory B. 

This works great but in the same move (after i called the extraction
method) i want to output said pdf-file to the browser 
e. g.
<embed src="/tmp/14153462345213.pdf...">

Basically with already existing pdf-files that works fine, but checking
the whole procedures inserting timing-outputs I realized that, although
the extraction method is done and the next methods are called, itext (or
the system) is still writing the file to directory B and therefore when
the browser tries to embed it (adobe plugin) its not fully written and
the adobe plugin can not read it because of that.

now I wonder how to solve that problem. So to my ideas:
        a) only continue after extraction when the file is fully written
                => Actually I have no idea about how to check that
        b) have the servlet wait/sleep for maybe up to a second
                => from what I found so far, sleeping a servlet is NOT
                good and on the other hand what if one pdf-page i want
                to extract is so big/has so many graphics in it that the
                process lasts longer than a second
                
would anybody have an idea or a hint to help me out ? 

Thanks in advance!

best regards

Ingo



Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to