Are you sure an exception is not thrown before the file is closed?

Paulo

----- Original Message ----- 
From: "milind" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, February 27, 2007 10:26 PM
Subject: Re: [iText-questions] Files are not beging closed


> Paulo Soares <psoares <at> consiste.pt> writes:
>>
>> What code are you using?
>>
>> Paulo
>>
>> ----- Original Message ----- 
>> From: "milind" <milind.pandit <at> db.com>
>> To: <itext-questions <at> lists.sourceforge.net>
>> Sent: Tuesday, February 27, 2007 7:49 PM
>> Subject: [iText-questions] Files are not beging closed
>>
>> > Hello,
>> > We are having a problem where we converts the tif images to pdf.
>> > We observed that the tif images opend using the RandomAccessFileOrArray
>> > are
>> > not beging closed. We are using the RandomAccessFileOrArray  close 
>> > method
>> > and
>> > it seems its not closing the files.
>> > Any advise?
>> >
>> > regards,
>> > milind
>> >
>> >
>> > -------------------------------------------------------------------------
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance to share
>> > your
>> > opinions on IT & business topics through brief surveys-and earn cash
>> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> > _______________________________________________
>> > iText-questions mailing list
>> > iText-questions <at> lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/itext-questions
>> > Buy the iText book: http://itext.ugent.be/itext-in-action/
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share 
>> your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> iText-questions mailing list
>> iText-questions <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>
>>
>
>
> I am using itext-1.4.jar.
> Here is the snippet of code. I am not sure how much this can help.
>             while (it.hasNext()) {
>                if(lLeaf != null && lLeaf.isEmpty() != true) {
>                    for(ii=0; ii<lLeaf.getSize(); ii++) {
>                      int comps = 0;
>                        //get tiff image file
>                      ra = new 
> RandomAccessFileOrArray(lLeaf.getImageFile(ii));
>                        if(ra==null) {
>                        n[0]=11;
>                        System.err.println("Image file is corrupted");
>                        break;
>                        }
>                        comps = TiffImage.getNumberOfPages(ra);
>                        //process pages of a tiff image
>                        for(int c=1;c<=comps;c++) {
>                          boolean[] rotate = new boolean[1];
>                            Image img = TiffImage.getTiffImage(ra,c);
>                            //check is image file is valid
>                            if(img==null) {
>                            n[0]=12;
>                            System.err.println("Image file is corrupted");
>                             }
>                            img = getSize(img,rotate);
>                            setPageSize(img,rotate);
>                            document.add(Chunk.NEXTPAGE);
>                            document.add(img);
>                            pageCounter +=2;
>                        } // addPages
>                    if (ra!=null) {
>                      ra.close();
>                      ra=null;
>                    }
>                    } // if Leaf exists
>                } //run through all Leafs


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to