By Date: <-- -->
By Thread: <-- -->

(no subject)




Here is one tiff file that gives me an error when ourprogram tries to open the file  through ITEXT software. There is no problem in opening the file manually. But ITEXT somehow is complaining about the file. Here is code from ITEXT where it fails and the error from the log file. We are baffled how to tackle the problem. We get the file from the bank and they think that they send the
right file.

Any insight will be highly appreciated.  Why the program fails on this tiff file and not on others. I am sending you two tiff files, bad and good ones.


Thanks

sankar


Here is one tiff file that gives me an error when ourprogram tries to open the file  through ITEXT software. There is no problem in opening the file manually. But ITEXT somehow is complaining about the file. Here is code from ITEXT where it fails and the error from the log file. We are baffled how to tackle the problem. We get the file from the bank and they think that they send the
right file.

Any insight will be highly appreciated.  Why the program fails on this tiff file and not on others. I am sending you two tiff files, bad and good ones.


Thanks

sankar


 (good file)

Extract from log file :

Good

com.axa.soc.AWDLockbox.AXATiff2Pdf: addOneTiffToDocument: begin
com.axa.soc.AWDLockbox.AXATiff2Pdf: Processing: c:\AWDLockbox\zip\work/M285380F.tif
com.axa.soc.AWDLockbox.AXATiff2Pdf: comps: 1
com.axa.soc.AWDLockbox.AXATiff2Pdf: setFontAndSize1
com.axa.soc.AWDLockbox.AXATiff2Pdf: Before running image: c:\AWDLockbox\zip\work/M285380F.tif
com.axa.soc.AWDLockbox.AXATiff2Pdf: img com.lowagie.text.ImgCCITT (at) 388993
com.axa.soc.AWDLockbox.AXATiff2Pdf: page 1
com.axa.soc.AWDLockbox.AXATiff2Pdf:  Debug: Rotated img c:\AWDLockbox\zip\work/M285380F.tif in pdf file c:\AWDLockbox\temp_rpts\Group_3_4_05_10_2006-00000015-0000013014-.pdf
com.axa.soc.AWDLockbox.AXATiff2Pdf:  Debug: scaling img c:\AWDLockbox\zip\work/M285380F.tif in pdf file c:\AWDLockbox\temp_rpts\Group_3_4_05_10_2006-00000015-0000013014-.pdf
com.axa.soc.AWDLockbox.AXATiff2Pdf:  Debug: about to close tiff file
com.axa.soc.AWDLockbox.AXATiff2Pdf:  Debug: addOneTiffToDocument: end
-------------------------------------------------------------------------------------------------------------------


(bad file)

Errors

com.axa.soc.AWDLockbox.AXATiff2Pdf: addOneTiffToDocument: begin
com.axa.soc.AWDLockbox.AXATiff2Pdf: Processing: c:\AWDLockbox\zip\work/M285381F.tif
com.axa.soc.AWDLockbox.AXATiff2Pdf: comps: 1
com.axa.soc.AWDLockbox.AXATiff2Pdf: setFontAndSize1
com.axa.soc.AWDLockbox.AXATiff2Pdf: Before running image: c:\AWDLockbox\zip\work/M285381F.tif
com.axa.soc.AWDLockbox.AXALockboxProcessor:  Debug: Inside finally block of endprocess
com.axa.soc.AWDLockbox.AXALockboxProcessor:  Debug: printStream not null
java.lang.OutOfMemoryError


Here is the code from ITEXT  where it fails:

log.println("Processing: " + tiff_file);
                try {
                  for (int c = 0; c < comps; ++c) {
                                          log.println("comps: " + comps);
                      try {
                          cb.beginText();
                            log.println ( "setFontAndSize1" );
                              cb.setFontAndSize(bf, 14);
                              cb.setTextMatrix(30, 30);
                              cb.showText( stampText );
                              cb.endText();
                              Image img = null;
                          try{log.println("Before running image: " + tiff_file);
                          img = TiffImage.getTiffImage(ra, c + 1);
                                          } catch (Exception e) {
                          log.logError("Exception " + tiff_file + " page " + (c + 1) + " " + e.getMessage());
                          throw e;
                                          }
                          log.println("img " +img);
                          if (img != null)
                             {try
                             {
                              log.println("page " + (c + 1));
                              if ( img.scaledHeight() > img.scaledWidth() )
                              {
                                img.setRotationDegrees( (long ) 90.0 );
                               log.debug ( "Rotated img " + tiff_file + " in pdf file " + pdf_file );
                              }
                              if (true ) // (img.scaledWidth() > scale_width || img.scaledHeight() > scale_height)
                              {
                               log.debug ( "scaling img " + tiff_file + " in pdf file " + pdf_file );
                                img.scaleToFit(scale_width, scale_height);
                              }
                              if ( false ) // (center_image) // Temp resizing kludge. Don't center.
                              {
                                  double width_adjustment = (scale_width - img.scaledWidth())/ 2 ;
                                  double height_adjustment = (scale_height - img.scaledHeight())/ 2 ;
                                 log.debug ( tiff_file + " width_adjustment: " + width_adjustment
                                           + " height: " + height_adjustment );
                                  img.setAbsolutePosition(img_x + (int) width_adjustment,
                                                          img_y + (int) height_adjustment);
                              }
                              else
                              {
                                  img.setAbsolutePosition(img_x, img_y);
                              }
                              cb.addImage(img);
                              cb.beginText();
                              cb.setFontAndSize(bf, 14);
                              cb.setTextMatrix(text_x, text_y);
                              cb.showText( stampText );
                              cb.endText();
                              document.newPage();
                              ++pages;
                                                  }


"Paulo Soares" <psoares (at) consiste.pt>

08/02/2006 10:02 AM

       
        To:        Sankar.Mukherjee (at) axa-equitable.com
        cc:        
        Subject:        Re: Tiff problem



Works for me. I attach the generated PDF.

Paulo

----- Original Message -----
From: <Sankar.Mukherjee (at) axa-equitable.com>
To: <psoares (at) consiste.pt>
Sent: Wednesday, August 02, 2006 1:02 PM
Subject: Tiff problem


> The following tiff file needs to be resized to 105% in Microsoft photo
> editor before it can be processed through ITEXT program.
>
> Thanks
>
> sankar
>
>
> The following tiff file needs to be resized to 105% in Microsoft photo
> editor before it can be processed through ITEXT program.
>
> Thanks
>
> sankar
>
>
>
>
>
>
>
>
>> -----Original Message-----
> > From: itext-questions-bounces (at) li...
> > [mailto:itext-questions-bounces (at) li...] On
> > Behalf Of Sankar.Mukherjee (at) ax...
> > Sent: Wednesday, July 26, 2006 4:42 PM
> > To: itext-questions (at) li...
> > Subject: [iText-questions] Tiff file problem
> >
> >
> > If the following statement fails due to corrupt image, how
> > should we catch this error instead of  the program being
> > abended and received an 'out of memory error '
> >
> > Image img = TiffImage.getTiffImage(ra, c + 1);
> >
>
> You can't catch it, it must be solved before happening. If you have an
> image with that problem send it to me.
>
> Paulo
>



**********************************************************************

Confidentiality Note: This message and any attachments
may contain legally privileged and/or confidential information.
Any unauthorized disclosure, use or dissemination of this e-mail
message or its contents, either in whole or in part, is prohibited.
If you are not the intended recipient of this e-mail message,
kindly notify the sender and then destroy it.

**********************************************************************

Attachment: M285380F.tif
Description: Binary data

Attachment: M285381F.tif
Description: Binary data

Attachment: test4.pdf
Description: Binary data

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions