I have done some more research on this problem, looks like the ones that are
created that print okay can be opened with ghostscript, however the ones that
can not be oppened ghostscript creates the following error:
Error: /syntaxerror in readxref
The xref is as follows:
xref
0 20
0000000000 65535 f
0000097210 00000 n
0000000015 00000 n
0000003602 00000 n
0000025847 00000 n
0000025986 00000 n
0000026153 00000 n
0000042446 00000 n
0000042585 00000 n
0000042752 00000 n
0000065639 00000 n
0000065779 00000 n
0000065948 00000 n
0000083576 00000 n
0000083716 00000 n
0000083886 00000 n
0000096900 00000 n
0000097040 00000 n
0000097294 00000 n
0000097344 00000 n
trailer
<<
/Size 20
/Root 18 0 R
/Info 19 0 R
>>
startxref
97527
%%EOF
Ideas?
Thanks!
Jared
Paulo Soares wrote:
> CCITT G4 is not supported by postscript 1 but I suppose that Acrobat
> converts it to something legal, or doesn't it?
>
> Best Regards,
> Paulo Soares
>
> ----- Original Message -----
> From: "Jared Ellson" <[EMAIL PROTECTED]>
> To: "Paulo Soares" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, April 05, 2002 17:21
> Subject: Re: [iText-questions] Printing PDF's with embedded tiffs from iText
>
> > Here is the code (I pretty much just used the example with minor mods):
> >
> >
> > public boolean tiffToPdf(String theTiffFile, String theOutFile)
> > {
> > Document document = null;
> >
> > try {
> > // creation of the different writers
> >
> > File file = new File(theTiffFile);
> > SeekableStream s = new FileSeekableStream(file);
> > TIFFDirectory dir = new TIFFDirectory(s, 0);
> > long IFDOffset = dir.getIFDOffset();
> > Watermark watermark = null;
> > PdfWriter writer = null;
> > PdfContentByte cb = null;
> >
> >
> > while (IFDOffset != 0L) {
> > dir = new TIFFDirectory(s, IFDOffset, 0);
> > IFDOffset = dir.getNextIFDOffset();
> > long h =
> > dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_LENGTH);
> > long w = dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_WIDTH);
> >
> > if (document == null)
> > {
> > if((int)w > 1800)
> > {
> > watermark = new
> > Watermark(Image.getInstance(ConverterProperties.WATERMARKLOC),0,-150);
> > document = new Document(PageSize.A4.rotate(), 50,
> > 50, 50, 50);
> > }
> > else
> > {
> > watermark = new
> > Watermark(Image.getInstance(ConverterProperties.WATERMARKLOC),0,0);
> > document = new Document(PageSize.A4, 50, 50, 50,
> > 50);
> > }
> > writer = PdfWriter.getInstance(document, new
> > FileOutputStream(theOutFile));
> > cb = writer.getDirectContent();
> > document.add(watermark);
> >
> > document.open();
> > }
> > else
> > {
> > if((int)w > 1700)
> > {
> > document.setPageSize(PageSize.A4.rotate());
> > }
> > else
> > {
> > document.setPageSize(PageSize.A4);
> > }
> > }
> > long offset =
> > dir.getFieldAsLong(TIFFImageDecoder.TIFF_STRIP_OFFSETS);
> > long size =
> > dir.getFieldAsLong(TIFFImageDecoder.TIFF_STRIP_BYTE_COUNTS);
> > boolean reverse = false;
> > if (dir.isTagPresent(TIFFImageDecoder.TIFF_FILL_ORDER))
> > reverse =
> > (dir.getFieldAsLong(TIFFImageDecoder.TIFF_FILL_ORDER) == 2L);
> > int compression =
> > (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_COMPRESSION);
> > switch (compression) {
> > case TIFFImage.COMP_FAX_G3_1D:
> > compression = Image.CCITTG3_1D;
> > break;
> > case TIFFImage.COMP_FAX_G3_2D:
> > compression = Image.CCITTG3_1D;
> > if
> > (dir.isTagPresent(TIFFImageDecoder.TIFF_T4_OPTIONS)) {
> > if
> > (((int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_T4_OPTIONS) & 1) != 0)
> > compression = Image.CCITTG3_2D;
> > }
> > break;
> > case TIFFImage.COMP_FAX_G4_2D:
> > compression = Image.CCITTG4;
> > break;
> > default:
> > throw new Exception("Compression type " +
> > compression + " not supported");
> > }
> > byte im[] = new byte[(int)size];
> > s.seek(offset);
> > s.readFully(im);
> > Image img = Image.getInstance((int)w, (int)h, reverse,
> > compression, 0, im);
> >
> > img.scalePercent(72f / 200f * 100);
> > img.setAbsolutePosition(0, 0);
> >
> >
> >
> >
> > cb.addImage(img);
> >
> >
> > document.newPage();
> > }
> > document.close();
> > return true;
> > }
> > catch (Exception de) {
> > de.printStackTrace();
> > createErrorPDF(theTiffFile, theOutFile);
> > return false;
> > }
> >
> >
> >
> >
> >
> >
> > }
> >
> >
> >
> >
> >
> >
> >
> > Paulo Soares wrote:
> >
> > > How are you inserting the tiffs in iText?
> > >
> > > Best Regards,
> > > Paulo Soares
> > >
> > > --- Jared Ellson <[EMAIL PROTECTED]> wrote:
> > > > Hi All,
> > > >
> > > > I was wondering if any has ran into or knows the
> > > > solition to problems
> > > > printing PDF with imbedded tiffs in iText. I have a
> > > > very large
> > > > application here at Sun that is now coverting tiff
> > > > documents to PDF
> > > > using iText. Before the application used libpdf to
> > > > convert tiffs. The
> > > > problem I have run into with iText is that new
> > > > documents that are
> > > > converted via iText are unable to print. I get a
> > > > postscript typecheck
> > > > error with the offending command being restore. I
> > > > am using Acrobat 4.0
> > > > with Post Script Level 1. Any ideas?
> > > >
> > > > Thanks!
> > > > Jared
> > > >
> > > >
> > > > _______________________________________________
> > > > iText-questions mailing list
> > > > [EMAIL PROTECTED]
> > > >
> > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Tax Center - online filing with TurboTax
> > > http://taxes.yahoo.com/
> > >
> > > _______________________________________________
> > > iText-questions mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> >
> > _______________________________________________
> > iText-questions mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions