Help

View: New views
12 Messages — Rating Filter:   Alert me  

Help

by thulasi ram :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,   
 I'm using iText Tiff2pdf method for converting Tiff to image pdf. I'm
   getting "Outofmemory" error while converting large size (morethen 5MB)
   images in the line of
   ra = *new* RandomAccessFileOrArray(inStream);.
   Can any one help how to create pdf for large size Tiff images.
 
Thanks,
Ram
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by Mark Storer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Give the JVM more memory when you create it:
 
This has almost nothing to do with iText, and everything to do with Java.
 

--Mark Storer
  Senior Software Engineer
  Cardiff.com

#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;

-----Original Message-----
From: thulasi ram [mailto:pthulasiram@...]
Sent: Monday, October 19, 2009 11:15 AM
To: itext-questions@...
Subject: [iText-questions] Help

Hi all,   
 I'm using iText Tiff2pdf method for converting Tiff to image pdf. I'm
   getting "Outofmemory" error while converting large size (morethen 5MB)
   images in the line of
   ra = *new* RandomAccessFileOrArray(inStream);.
   Can any one help how to create pdf for large size Tiff images.
 
Thanks,
Ram
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Not only that, if you use a stream it's read to a byte array. Use a file
instead.

Paulo

----- Original Message -----
From: "Mark Storer" <MStorer@...>
To: "Post all your questions about iText here"
<itext-questions@...>
Sent: Monday, October 19, 2009 9:24 PM
Subject: Re: [iText-questions] Help


Give the JVM more memory when you create it:
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html

This has almost nothing to do with iText, and everything to do with Java.


--Mark Storer
  Senior Software Engineer
  Cardiff.com

#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;

-----Original Message-----
From: thulasi ram [mailto:pthulasiram@...]
Sent: Monday, October 19, 2009 11:15 AM
To: itext-questions@...
Subject: [iText-questions] Help

Hi all,
 I'm using iText Tiff2pdf method for converting Tiff to image pdf. I'm
   getting "Outofmemory" error while converting large size (morethen 5MB)
   images in the line of
   ra = *new* RandomAccessFileOrArray(inStream);.
   Can any one help how to create pdf for large size Tiff images.

Thanks,
Ram



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by thulasi ram :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for ur response.
I have one more issue.
I have multipage color tiff, while i'm using Image.getInstance write to pdf file always getting single page pdf file.
 
If i'll use Image.getInstance i can able to read color tiff images but i'm not able to create multipage pdf file.
If I'll use Image.getTiffImage i can't able to read color tiff iamges. 
 
Can any one let me know how get multipage pdf file using Image.getInstance. Its posible to color Tiff to pdf file using iText?
 
Here is my code.
tempFile = new File(finalPath);
FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
byte[] read = new byte[input.available()];

File cacheFile = new File(finalPath1);
FileOutputStream bos = new FileOutputStream(cacheFile);
   
ByteArrayOutputStream outfile = new ByteArrayOutputStream();
Document document = new Document(PageSize.A4.rotate());
PdfWriter writer = PdfWriter.getInstance(document, bos);
writer.setStrictImageSequence(true);
document.open();
Image tiff = Image.getInstance(read);
tiff.scaleToFit(800, 600);
document.add(tiff);
document.close();
outfile.flush();
 
 


 
On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares <psoares@...> wrote:
Not only that, if you use a stream it's read to a byte array. Use a file
instead.

Paulo

----- Original Message -----
From: "Mark Storer" <MStorer@...>
To: "Post all your questions about iText here"
<itext-questions@...>
Sent: Monday, October 19, 2009 9:24 PM
Subject: Re: [iText-questions] Help


Give the JVM more memory when you create it:
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html

This has almost nothing to do with iText, and everything to do with Java.


--Mark Storer
 Senior Software Engineer
 Cardiff.com

#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;

-----Original Message-----
From: thulasi ram [mailto:pthulasiram@...]
Sent: Monday, October 19, 2009 11:15 AM
To: itext-questions@...
Subject: [iText-questions] Help

Hi all,
 I'm using iText Tiff2pdf method for converting Tiff to image pdf. I'm
  getting "Outofmemory" error while converting large size (morethen 5MB)
  images in the line of
  ra = *new* RandomAccessFileOrArray(inStream);.
  Can any one help how to create pdf for large size Tiff images.

Thanks,
Ram



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by Mark Storer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you want each image to be on its own page, you should call document.newPage() after document.add().
 

--Mark Storer
  Senior Software Engineer
  Cardiff.com

#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;

-----Original Message-----
From: thulasi ram [mailto:pthulasiram@...]
Sent: Wednesday, October 21, 2009 12:11 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Help

Thanks for ur response.
I have one more issue.
I have multipage color tiff, while i'm using Image.getInstance write to pdf file always getting single page pdf file.
 
If i'll use Image.getInstance i can able to read color tiff images but i'm not able to create multipage pdf file.
If I'll use Image.getTiffImage i can't able to read color tiff iamges. 
 
Can any one let me know how get multipage pdf file using Image.getInstance. Its posible to color Tiff to pdf file using iText?
 
Here is my code.
tempFile = new File(finalPath);
FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
byte[] read = new byte[input.available()];

File cacheFile = new File(finalPath1);
FileOutputStream bos = new FileOutputStream(cacheFile);
   
ByteArrayOutputStream outfile = new ByteArrayOutputStream();
Document document = new Document(PageSize.A4.rotate());
PdfWriter writer = PdfWriter.getInstance(document, bos);
writer.setStrictImageSequence(true);
document.open();
Image tiff = Image.getInstance(read);
tiff.scaleToFit(800, 600);
document.add(tiff);
document.close();
outfile.flush();
 
 


 
On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares <psoares@...> wrote:
Not only that, if you use a stream it's read to a byte array. Use a file
instead.

Paulo

----- Original Message -----
From: "Mark Storer" <MStorer@...>
To: "Post all your questions about iText here"
<itext-questions@...>
Sent: Monday, October 19, 2009 9:24 PM
Subject: Re: [iText-questions] Help


Give the JVM more memory when you create it:
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html

This has almost nothing to do with iText, and everything to do with Java.


--Mark Storer
 Senior Software Engineer
 Cardiff.com

#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;

-----Original Message-----
From: thulasi ram [mailto:pthulasiram@...]
Sent: Monday, October 19, 2009 11:15 AM
To: itext-questions@...
Subject: [iText-questions] Help

Hi all,
 I'm using iText Tiff2pdf method for converting Tiff to image pdf. I'm
  getting "Outofmemory" error while converting large size (morethen 5MB)
  images in the line of
  ra = *new* RandomAccessFileOrArray(inStream);.
  Can any one help how to create pdf for large size Tiff images.

Thanks,
Ram



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use class com.lowagie.text.pdf.codec.TiffImage to get all the images inside the tiff.

Paulo

> -----Original Message-----
> From: thulasi ram [mailto:pthulasiram@...]
> Sent: Wednesday, October 21, 2009 8:11 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Help
>
> Thanks for ur response.
> I have one more issue.
> I have multipage color tiff, while i'm using
> Image.getInstance write to pdf file always getting single
> page pdf file.
>  
> If i'll use Image.getInstance i can able to read color tiff
> images but i'm not able to create multipage pdf file.
> If I'll use Image.getTiffImage i can't able to read color
> tiff iamges.
>  
> Can any one let me know how get multipage pdf file using
> Image.getInstance. Its posible to color Tiff to pdf file using iText?
>  
> Here is my code.
> tempFile = new File(finalPath);
> FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
> byte[] read = new byte[input.available()];
>
> File cacheFile = new File(finalPath1);
> FileOutputStream bos = new FileOutputStream(cacheFile);
>    
> ByteArrayOutputStream outfile = new ByteArrayOutputStream();
> Document document = new Document(PageSize.A4.rotate());
> PdfWriter writer = PdfWriter.getInstance(document, bos);
> writer.setStrictImageSequence(true);
> document.open();
> Image tiff = Image.getInstance(read);
> tiff.scaleToFit(800, 600);
> document.add(tiff);
> document.close();
> outfile.flush();
>
>  
>  
>
>
>  
> On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares
> <psoares@...> wrote:
>
>
> Not only that, if you use a stream it's read to a byte
> array. Use a file
> instead.
>
> Paulo
>
>
> ----- Original Message -----
> From: "Mark Storer" <MStorer@...>
> To: "Post all your questions about iText here"
> <itext-questions@...>
>
> Sent: Monday, October 19, 2009 9:24 PM
> Subject: Re: [iText-questions] Help
>
>
> Give the JVM more memory when you create it:
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
>
> This has almost nothing to do with iText, and
> everything to do with Java.
>
>
> --Mark Storer
> Senior Software Engineer
> Cardiff.com
>
> #include <disclaimer>
> typedef std::Disclaimer<Cardiff> DisCard;
>
> -----Original Message-----
> From: thulasi ram [mailto:pthulasiram@...]
> Sent: Monday, October 19, 2009 11:15 AM
> To: itext-questions@...
> Subject: [iText-questions] Help
>
> Hi all,
> I'm using iText Tiff2pdf method for converting Tiff to
> image pdf. I'm
>  getting "Outofmemory" error while converting large
> size (morethen 5MB)
>  images in the line of
>  ra = *new* RandomAccessFileOrArray(inStream);.
>  Can any one help how to create pdf for large size Tiff images.
>
> Thanks,
> Ram
>
>
>
>
>
> --------------------------------------------------------------
> ----------------
> Come build with us! The BlackBerry(R) Developer
> Conference in SF, CA
> is the only developer event you need to attend this
> year. Jumpstart your
> developing skills, take BlackBerry mobile applications
> to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009.
> Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> iText-questions mailing list
> iText-questions@...
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
>
>
>
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by thulasi ram :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, I'll try. Using getInstance(read); how can i loop the page.
Can any one send me sample code its more useful for me.

Thanks,
Ram



On Wed, Oct 21, 2009 at 5:39 PM, Paulo Soares <psoares@...> wrote:
Use class com.lowagie.text.pdf.codec.TiffImage to get all the images inside the tiff.

Paulo

> -----Original Message-----
> From: thulasi ram [mailto:pthulasiram@...]
> Sent: Wednesday, October 21, 2009 8:11 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Help
>
> Thanks for ur response.
> I have one more issue.
> I have multipage color tiff, while i'm using
> Image.getInstance write to pdf file always getting single
> page pdf file.
>
> If i'll use Image.getInstance i can able to read color tiff
> images but i'm not able to create multipage pdf file.
> If I'll use Image.getTiffImage i can't able to read color
> tiff iamges.
>
> Can any one let me know how get multipage pdf file using
> Image.getInstance. Its posible to color Tiff to pdf file using iText?
>
> Here is my code.
> tempFile = new File(finalPath);
> FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
> byte[] read = new byte[input.available()];
>
> File cacheFile = new File(finalPath1);
> FileOutputStream bos = new FileOutputStream(cacheFile);
>
> ByteArrayOutputStream outfile = new ByteArrayOutputStream();
> Document document = new Document(PageSize.A4.rotate());
> PdfWriter writer = PdfWriter.getInstance(document, bos);
> writer.setStrictImageSequence(true);
> document.open();
> Image tiff = Image.getInstance(read);
> tiff.scaleToFit(800, 600);
> document.add(tiff);
> document.close();
> outfile.flush();
>
>
>
>
>
>
> On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares
> <psoares@...> wrote:
>
>
>       Not only that, if you use a stream it's read to a byte
> array. Use a file
>       instead.
>
>       Paulo
>
>
>       ----- Original Message -----
>       From: "Mark Storer" <MStorer@...>
>       To: "Post all your questions about iText here"
>       <itext-questions@...>
>
>       Sent: Monday, October 19, 2009 9:24 PM
>       Subject: Re: [iText-questions] Help
>
>
>       Give the JVM more memory when you create it:
>       http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
>
>       This has almost nothing to do with iText, and
> everything to do with Java.
>
>
>       --Mark Storer
>        Senior Software Engineer
>        Cardiff.com
>
>       #include <disclaimer>
>       typedef std::Disclaimer<Cardiff> DisCard;
>
>       -----Original Message-----
>       From: thulasi ram [mailto:pthulasiram@...]
>       Sent: Monday, October 19, 2009 11:15 AM
>       To: itext-questions@...
>       Subject: [iText-questions] Help
>
>       Hi all,
>        I'm using iText Tiff2pdf method for converting Tiff to
> image pdf. I'm
>         getting "Outofmemory" error while converting large
> size (morethen 5MB)
>         images in the line of
>         ra = *new* RandomAccessFileOrArray(inStream);.
>         Can any one help how to create pdf for large size Tiff images.
>
>       Thanks,
>       Ram
>
>
>
>
>
> --------------------------------------------------------------
> ----------------
>       Come build with us! The BlackBerry(R) Developer
> Conference in SF, CA
>       is the only developer event you need to attend this
> year. Jumpstart your
>       developing skills, take BlackBerry mobile applications
> to market and stay
>       ahead of the curve. Join us from November 9 - 12, 2009.
> Register now!
>       http://p.sf.net/sfu/devconference
>       _______________________________________________
>       iText-questions mailing list
>       iText-questions@...
>       https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>       Buy the iText book: http://www.1t3xt.com/docs/book.php
>       Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
>       You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
>
>
>
>

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It's always useful if someone does your work and I was already missing the "send sample code". See http://1t3xt.be/?X0001bd.

Paulo

> -----Original Message-----
> From: thulasi ram [mailto:pthulasiram@...]
> Sent: Wednesday, October 21, 2009 11:42 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Help
>
> Thanks, I'll try. Using getInstance(read); how can i loop the page.
> Can any one send me sample code its more useful for me.
>
> Thanks,
> Ram
>
>
>
> On Wed, Oct 21, 2009 at 5:39 PM, Paulo Soares
> <psoares@...> wrote:
>
>
> Use class com.lowagie.text.pdf.codec.TiffImage to get
> all the images inside the tiff.
>
> Paulo
>
>
> > -----Original Message-----
> > From: thulasi ram [mailto:pthulasiram@...]
>
> > Sent: Wednesday, October 21, 2009 8:11 PM
> > To: Post all your questions about iText here
>
> > Subject: Re: [iText-questions] Help
> >
> > Thanks for ur response.
> > I have one more issue.
> > I have multipage color tiff, while i'm using
> > Image.getInstance write to pdf file always getting single
> > page pdf file.
> >
> > If i'll use Image.getInstance i can able to read color tiff
> > images but i'm not able to create multipage pdf file.
> > If I'll use Image.getTiffImage i can't able to read color
> > tiff iamges.
> >
> > Can any one let me know how get multipage pdf file using
> > Image.getInstance. Its posible to color Tiff to pdf
> file using iText?
> >
> > Here is my code.
> > tempFile = new File(finalPath);
> > FileOutputStream fileOutputStream = new
> FileOutputStream(tempFile);
> > byte[] read = new byte[input.available()];
> >
> > File cacheFile = new File(finalPath1);
> > FileOutputStream bos = new FileOutputStream(cacheFile);
> >
> > ByteArrayOutputStream outfile = new ByteArrayOutputStream();
> > Document document = new Document(PageSize.A4.rotate());
> > PdfWriter writer = PdfWriter.getInstance(document, bos);
> > writer.setStrictImageSequence(true);
> > document.open();
> > Image tiff = Image.getInstance(read);
> > tiff.scaleToFit(800, 600);
> > document.add(tiff);
> > document.close();
> > outfile.flush();
> >
> >
> >
> >
> >
> >
> > On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares
> > <psoares@...> wrote:
> >
> >
> >       Not only that, if you use a stream it's read to a byte
> > array. Use a file
> >       instead.
> >
> >       Paulo
> >
> >
> >       ----- Original Message -----
> >       From: "Mark Storer" <MStorer@...>
> >       To: "Post all your questions about iText here"
> >       <itext-questions@...>
> >
> >       Sent: Monday, October 19, 2009 9:24 PM
> >       Subject: Re: [iText-questions] Help
> >
> >
> >       Give the JVM more memory when you create it:
> >      
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
> >
> >       This has almost nothing to do with iText, and
> > everything to do with Java.
> >
> >
> >       --Mark Storer
> >        Senior Software Engineer
> >        Cardiff.com
> >
> >       #include <disclaimer>
> >       typedef std::Disclaimer<Cardiff> DisCard;
> >
> >       -----Original Message-----
> >       From: thulasi ram [mailto:pthulasiram@...]
> >       Sent: Monday, October 19, 2009 11:15 AM
> >       To: itext-questions@...
> >       Subject: [iText-questions] Help
> >
> >       Hi all,
> >        I'm using iText Tiff2pdf method for converting Tiff to
> > image pdf. I'm
> >         getting "Outofmemory" error while converting large
> > size (morethen 5MB)
> >         images in the line of
> >         ra = *new* RandomAccessFileOrArray(inStream);.
> >         Can any one help how to create pdf for large
> size Tiff images.
> >
> >       Thanks,
> >       Ram

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by thulasi ram :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Paulo. The method TiffImage.getTiffImage(ra,i)  not support for color images.
 

On Thu, Oct 22, 2009 at 5:13 AM, Paulo Soares <psoares@...> wrote:
It's always useful if someone does your work and I was already missing the "send sample code". See http://1t3xt.be/?X0001bd.

Paulo

> -----Original Message-----
> From: thulasi ram [mailto:pthulasiram@...]
> Sent: Wednesday, October 21, 2009 11:42 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Help
>
> Thanks, I'll try. Using getInstance(read); how can i loop the page.
> Can any one send me sample code its more useful for me.
>
> Thanks,
> Ram
>
>
>
> On Wed, Oct 21, 2009 at 5:39 PM, Paulo Soares
> <psoares@...> wrote:
>
>
>       Use class com.lowagie.text.pdf.codec.TiffImage to get
> all the images inside the tiff.
>
>       Paulo
>
>
>       > -----Original Message-----
>       > From: thulasi ram [mailto:pthulasiram@...]
>
>       > Sent: Wednesday, October 21, 2009 8:11 PM
>       > To: Post all your questions about iText here
>
>       > Subject: Re: [iText-questions] Help
>       >
>       > Thanks for ur response.
>       > I have one more issue.
>       > I have multipage color tiff, while i'm using
>       > Image.getInstance write to pdf file always getting single
>       > page pdf file.
>       >
>       > If i'll use Image.getInstance i can able to read color tiff
>       > images but i'm not able to create multipage pdf file.
>       > If I'll use Image.getTiffImage i can't able to read color
>       > tiff iamges.
>       >
>       > Can any one let me know how get multipage pdf file using
>       > Image.getInstance. Its posible to color Tiff to pdf
> file using iText?
>       >
>       > Here is my code.
>       > tempFile = new File(finalPath);
>       > FileOutputStream fileOutputStream = new
> FileOutputStream(tempFile);
>       > byte[] read = new byte[input.available()];
>       >
>       > File cacheFile = new File(finalPath1);
>       > FileOutputStream bos = new FileOutputStream(cacheFile);
>       >
>       > ByteArrayOutputStream outfile = new ByteArrayOutputStream();
>       > Document document = new Document(PageSize.A4.rotate());
>       > PdfWriter writer = PdfWriter.getInstance(document, bos);
>       > writer.setStrictImageSequence(true);
>       > document.open();
>       > Image tiff = Image.getInstance(read);
>       > tiff.scaleToFit(800, 600);
>       > document.add(tiff);
>       > document.close();
>       > outfile.flush();
>       >
>       >
>       >
>       >
>       >
>       >
>       > On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares
>       > <psoares@...> wrote:
>       >
>       >
>       >       Not only that, if you use a stream it's read to a byte
>       > array. Use a file
>       >       instead.
>       >
>       >       Paulo
>       >
>       >
>       >       ----- Original Message -----
>       >       From: "Mark Storer" <MStorer@...>
>       >       To: "Post all your questions about iText here"
>       >       <itext-questions@...>
>       >
>       >       Sent: Monday, October 19, 2009 9:24 PM
>       >       Subject: Re: [iText-questions] Help
>       >
>       >
>       >       Give the JVM more memory when you create it:
>       >
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
>       >
>       >       This has almost nothing to do with iText, and
>       > everything to do with Java.
>       >
>       >
>       >       --Mark Storer
>       >        Senior Software Engineer
>       >        Cardiff.com
>       >
>       >       #include <disclaimer>
>       >       typedef std::Disclaimer<Cardiff> DisCard;
>       >
>       >       -----Original Message-----
>       >       From: thulasi ram [mailto:pthulasiram@...]
>       >       Sent: Monday, October 19, 2009 11:15 AM
>       >       To: itext-questions@...
>       >       Subject: [iText-questions] Help
>       >
>       >       Hi all,
>       >        I'm using iText Tiff2pdf method for converting Tiff to
>       > image pdf. I'm
>       >         getting "Outofmemory" error while converting large
>       > size (morethen 5MB)
>       >         images in the line of
>       >         ra = *new* RandomAccessFileOrArray(inStream);.
>       >         Can any one help how to create pdf for large
> size Tiff images.
>       >
>       >       Thanks,
>       >       Ram


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, it does support color images.

Paulo

----- Original Message -----
From: "thulasi ram" <pthulasiram@...>
To: "Post all your questions about iText here"
<itext-questions@...>
Sent: Thursday, October 22, 2009 9:27 PM
Subject: Re: [iText-questions] Help


Thanks Paulo. The method
TiffImage<http://www.1t3xt.info/api/com/lowagie/text/pdf/codec/TiffImage.html>.getTiffImage(ra,i)
not support for color images.


On Thu, Oct 22, 2009 at 5:13 AM, Paulo Soares
<psoares@...<mailto:psoares@...>> wrote:
It's always useful if someone does your work and I was already missing the
"send sample code". See http://1t3xt.be/?X0001bd.

Paulo

> -----Original Message-----
> From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
> Sent: Wednesday, October 21, 2009 11:42 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Help
>
> Thanks, I'll try. Using getInstance(read); how can i loop the page.
> Can any one send me sample code its more useful for me.
>
> Thanks,
> Ram
>
>
>
> On Wed, Oct 21, 2009 at 5:39 PM, Paulo Soares
> <psoares@...<mailto:psoares@...>> wrote:
>
>
>       Use class com.lowagie.text.pdf.codec.TiffImage to get
> all the images inside the tiff.
>
>       Paulo
>
>
>       > -----Original Message-----
>       > From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
>
>       > Sent: Wednesday, October 21, 2009 8:11 PM
>       > To: Post all your questions about iText here
>
>       > Subject: Re: [iText-questions] Help
>       >
>       > Thanks for ur response.
>       > I have one more issue.
>       > I have multipage color tiff, while i'm using
>       > Image.getInstance write to pdf file always getting single
>       > page pdf file.
>       >
>       > If i'll use Image.getInstance i can able to read color tiff
>       > images but i'm not able to create multipage pdf file.
>       > If I'll use Image.getTiffImage i can't able to read color
>       > tiff iamges.
>       >
>       > Can any one let me know how get multipage pdf file using
>       > Image.getInstance. Its posible to color Tiff to pdf
> file using iText?
>       >
>       > Here is my code.
>       > tempFile = new File(finalPath);
>       > FileOutputStream fileOutputStream = new
> FileOutputStream(tempFile);
>       > byte[] read = new byte[input.available()];
>       >
>       > File cacheFile = new File(finalPath1);
>       > FileOutputStream bos = new FileOutputStream(cacheFile);
>       >
>       > ByteArrayOutputStream outfile = new ByteArrayOutputStream();
>       > Document document = new Document(PageSize.A4.rotate());
>       > PdfWriter writer = PdfWriter.getInstance(document, bos);
>       > writer.setStrictImageSequence(true);
>       > document.open();
>       > Image tiff = Image.getInstance(read);
>       > tiff.scaleToFit(800, 600);
>       > document.add(tiff);
>       > document.close();
>       > outfile.flush();
>       >
>       >
>       >
>       >
>       >
>       >
>       > On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares
>       > <psoares@...<mailto:psoares@...>> wrote:
>       >
>       >
>       >       Not only that, if you use a stream it's read to a byte
>       > array. Use a file
>       >       instead.
>       >
>       >       Paulo
>       >
>       >
>       >       ----- Original Message -----
>       >       From: "Mark Storer"
> <MStorer@...<mailto:MStorer@...>>
>       >       To: "Post all your questions about iText here"
>       >
> <itext-questions@...<mailto:itext-questions@...>>
>       >
>       >       Sent: Monday, October 19, 2009 9:24 PM
>       >       Subject: Re: [iText-questions] Help
>       >
>       >
>       >       Give the JVM more memory when you create it:
>       >
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
>       >
>       >       This has almost nothing to do with iText, and
>       > everything to do with Java.
>       >
>       >
>       >       --Mark Storer
>       >        Senior Software Engineer
>       >        Cardiff.com
>       >
>       >       #include <disclaimer>
>       >       typedef std::Disclaimer<Cardiff> DisCard;
>       >
>       >       -----Original Message-----
>       >       From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
>       >       Sent: Monday, October 19, 2009 11:15 AM
>       >       To:
> itext-questions@...<mailto:itext-questions@...>
>       >       Subject: [iText-questions] Help
>       >
>       >       Hi all,
>       >        I'm using iText Tiff2pdf method for converting Tiff to
>       > image pdf. I'm
>       >         getting "Outofmemory" error while converting large
>       > size (morethen 5MB)
>       >         images in the line of
>       >         ra = *new* RandomAccessFileOrArray(inStream);.
>       >         Can any one help how to create pdf for large
> size Tiff images.
>       >
>       >       Thanks,
>       >       Ram


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by thulasi ram :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paulo,
 
Thanks for your code, its working for color images. I'm facing one issue, I have multipage tiff(morethan 3pages) , While doing the For loop 1st page is coming fine, Loop for 2nd page I'm getting "ExceptionConverter: java.io.EOFException" error.
 
If anyone know the anser help me out with code.
 
Here is my code.
--------------------------

String outputPdfFile = getTempPath()
+ ConstantsUtil.FOLDER_FILE_SEPERATOR + FName;
String inputTiffFile = tempFile.getAbsolutePath();
PdfWriter
.getInstance(document, new FileOutputStream(outputPdfFile));
document.open();
// document.add(new Paragraph(
// "This is the tiff added with Image.getInstance:"));
Image tiff = Image.getInstance(inputTiffFile);   // Reading the 1st page
if (tiff.getScaledWidth() > 500 || tiff.getScaledHeight() > 700) {
tiff.scaleToFit(500, 700);
}
document.add(tiff);
// document.add(Image.getInstance(inputTiffFile));
RandomAccessFileOrArray ra = new RandomAccessFileOrArray(
inputTiffFile);
int pages = TiffImage.getNumberOfPages(ra);
// document.add(new Paragraph(pages));
 
// Loop for other pages. Pages starts with 1.......
for (int i = 1; i < pages;) {
++i;
document.newPage();
Image tiff1 = TiffImage.getTiffImage(ra, i);  // EOF error for 2time loop
if (tiff1.getScaledWidth() > 500
|| tiff1.getScaledHeight() > 700) {
tiff1.scaleToFit(500, 700);
}
document.add(tiff1);
}
document.close();
ra.close();
 


 
On Thu, Oct 22, 2009 at 4:13 PM, Paulo Soares <psoares@...> wrote:
Yes, it does support color images.

Paulo

----- Original Message -----
From: "thulasi ram" <pthulasiram@...>
To: "Post all your questions about iText here"
<itext-questions@...>
Sent: Thursday, October 22, 2009 9:27 PM
Subject: Re: [iText-questions] Help


Thanks Paulo. The method
TiffImage<http://www.1t3xt.info/api/com/lowagie/text/pdf/codec/TiffImage.html>.getTiffImage(ra,i)
not support for color images.


On Thu, Oct 22, 2009 at 5:13 AM, Paulo Soares
<psoares@...<mailto:psoares@...>> wrote:
It's always useful if someone does your work and I was already missing the
"send sample code". See http://1t3xt.be/?X0001bd.

Paulo

> -----Original Message-----
> From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
> Sent: Wednesday, October 21, 2009 11:42 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Help
>
> Thanks, I'll try. Using getInstance(read); how can i loop the page.
> Can any one send me sample code its more useful for me.
>
> Thanks,
> Ram
>
>
>
> On Wed, Oct 21, 2009 at 5:39 PM, Paulo Soares
> <psoares@...<mailto:psoares@...>> wrote:
>
>
>       Use class com.lowagie.text.pdf.codec.TiffImage to get
> all the images inside the tiff.
>
>       Paulo
>
>
>       > -----Original Message-----
>       > From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
>
>       > Sent: Wednesday, October 21, 2009 8:11 PM
>       > To: Post all your questions about iText here
>
>       > Subject: Re: [iText-questions] Help
>       >
>       > Thanks for ur response.
>       > I have one more issue.
>       > I have multipage color tiff, while i'm using
>       > Image.getInstance write to pdf file always getting single
>       > page pdf file.
>       >
>       > If i'll use Image.getInstance i can able to read color tiff
>       > images but i'm not able to create multipage pdf file.
>       > If I'll use Image.getTiffImage i can't able to read color
>       > tiff iamges.
>       >
>       > Can any one let me know how get multipage pdf file using
>       > Image.getInstance. Its posible to color Tiff to pdf
> file using iText?
>       >
>       > Here is my code.
>       > tempFile = new File(finalPath);
>       > FileOutputStream fileOutputStream = new
> FileOutputStream(tempFile);
>       > byte[] read = new byte[input.available()];
>       >
>       > File cacheFile = new File(finalPath1);
>       > FileOutputStream bos = new FileOutputStream(cacheFile);
>       >
>       > ByteArrayOutputStream outfile = new ByteArrayOutputStream();
>       > Document document = new Document(PageSize.A4.rotate());
>       > PdfWriter writer = PdfWriter.getInstance(document, bos);
>       > writer.setStrictImageSequence(true);
>       > document.open();
>       > Image tiff = Image.getInstance(read);
>       > tiff.scaleToFit(800, 600);
>       > document.add(tiff);
>       > document.close();
>       > outfile.flush();
>       >
>       >
>       >
>       >
>       >
>       >
>       > On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares
>       > <psoares@...<mailto:psoares@...>> wrote:
>       >
>       >
>       >       Not only that, if you use a stream it's read to a byte
>       > array. Use a file
>       >       instead.
>       >
>       >       Paulo
>       >
>       >
>       >       ----- Original Message -----
>       >       From: "Mark Storer"
> <MStorer@...<mailto:MStorer@...>>
>       >       To: "Post all your questions about iText here"
>       >
> <itext-questions@...<mailto:itext-questions@...>>
>       >
>       >       Sent: Monday, October 19, 2009 9:24 PM
>       >       Subject: Re: [iText-questions] Help
>       >
>       >
>       >       Give the JVM more memory when you create it:
>       >
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
>       >
>       >       This has almost nothing to do with iText, and
>       > everything to do with Java.
>       >
>       >
>       >       --Mark Storer
>       >        Senior Software Engineer
>       >        Cardiff.com
>       >
>       >       #include <disclaimer>
>       >       typedef std::Disclaimer<Cardiff> DisCard;
>       >
>       >       -----Original Message-----
>       >       From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
>       >       Sent: Monday, October 19, 2009 11:15 AM
>       >       To:
> itext-questions@...<mailto:itext-questions@...>
>       >       Subject: [iText-questions] Help
>       >
>       >       Hi all,
>       >        I'm using iText Tiff2pdf method for converting Tiff to
>       > image pdf. I'm
>       >         getting "Outofmemory" error while converting large
>       > size (morethen 5MB)
>       >         images in the line of
>       >         ra = *new* RandomAccessFileOrArray(inStream);.
>       >         Can any one help how to create pdf for large
> size Tiff images.
>       >
>       >       Thanks,
>       >       Ram


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: Help

by thulasi ram :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, If create the New RandomAccessFileOrArray inside the “For” loop I'm not getting EOF error.

They way I'm using its correct? Or any other approach is available?

 

 
Here is my code
-----------------------
 RandomAccessFileOrArray ra = new RandomAccessFileOrArray(
inputTiffFile);
int pages = TiffImage.getNumberOfPages(ra);
ra.close();
for (int c = 0; c < pages; ++c) {
RandomAccessFileOrArray raf = new RandomAccessFileOrArray(
inputTiffFile);
Image tiff1 = TiffImage.getTiffImage(raf, c + 1);
if (tiff1.getScaledWidth() > 500
|| tiff1.getScaledHeight() > 700) {
tiff1.scaleToFit(500, 700);
}
document.add(tiff1);
document.newPage();
raf.close();
}
 


 
On Mon, Oct 26, 2009 at 11:03 AM, thulasi ram <pthulasiram@...> wrote:
Paulo,
 
Thanks for your code, its working for color images. I'm facing one issue, I have multipage tiff(morethan 3pages) , While doing the For loop 1st page is coming fine, Loop for 2nd page I'm getting "ExceptionConverter: java.io.EOFException" error.
 
If anyone know the anser help me out with code.
 
Here is my code.
--------------------------

String outputPdfFile = getTempPath()
+ ConstantsUtil.FOLDER_FILE_SEPERATOR + FName;
String inputTiffFile = tempFile.getAbsolutePath();
PdfWriter
.getInstance(document, new FileOutputStream(outputPdfFile));
document.open();
// document.add(new Paragraph(
// "This is the tiff added with Image.getInstance:"));
Image tiff = Image.getInstance(inputTiffFile);   // Reading the 1st page
if (tiff.getScaledWidth() > 500 || tiff.getScaledHeight() > 700) {
tiff.scaleToFit(500, 700);
}
document.add(tiff);
// document.add(Image.getInstance(inputTiffFile));
RandomAccessFileOrArray ra = new RandomAccessFileOrArray(
inputTiffFile);
int pages = TiffImage.getNumberOfPages(ra);
// document.add(new Paragraph(pages));
 
// Loop for other pages. Pages starts with 1.......
for (int i = 1; i < pages;) {
++i;
document.newPage();
Image tiff1 = TiffImage.getTiffImage(ra, i);  // EOF error for 2time loop
if (tiff1.getScaledWidth() > 500
|| tiff1.getScaledHeight() > 700) {
tiff1.scaleToFit(500, 700);
}
document.add(tiff1);
}
document.close();
ra.close();
 


 
On Thu, Oct 22, 2009 at 4:13 PM, Paulo Soares <psoares@...> wrote:
Yes, it does support color images.

Paulo

----- Original Message -----
From: "thulasi ram" <pthulasiram@...>
To: "Post all your questions about iText here"
<itext-questions@...>
Sent: Thursday, October 22, 2009 9:27 PM
Subject: Re: [iText-questions] Help


Thanks Paulo. The method
TiffImage<http://www.1t3xt.info/api/com/lowagie/text/pdf/codec/TiffImage.html>.getTiffImage(ra,i)
not support for color images.


On Thu, Oct 22, 2009 at 5:13 AM, Paulo Soares
<psoares@...<mailto:psoares@...>> wrote:
It's always useful if someone does your work and I was already missing the
"send sample code". See http://1t3xt.be/?X0001bd.

Paulo

> -----Original Message-----
> From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
> Sent: Wednesday, October 21, 2009 11:42 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Help
>
> Thanks, I'll try. Using getInstance(read); how can i loop the page.
> Can any one send me sample code its more useful for me.
>
> Thanks,
> Ram
>
>
>
> On Wed, Oct 21, 2009 at 5:39 PM, Paulo Soares
> <psoares@...<mailto:psoares@...>> wrote:
>
>
>       Use class com.lowagie.text.pdf.codec.TiffImage to get
> all the images inside the tiff.
>
>       Paulo
>
>
>       > -----Original Message-----
>       > From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
>
>       > Sent: Wednesday, October 21, 2009 8:11 PM
>       > To: Post all your questions about iText here
>
>       > Subject: Re: [iText-questions] Help
>       >
>       > Thanks for ur response.
>       > I have one more issue.
>       > I have multipage color tiff, while i'm using
>       > Image.getInstance write to pdf file always getting single
>       > page pdf file.
>       >
>       > If i'll use Image.getInstance i can able to read color tiff
>       > images but i'm not able to create multipage pdf file.
>       > If I'll use Image.getTiffImage i can't able to read color
>       > tiff iamges.
>       >
>       > Can any one let me know how get multipage pdf file using
>       > Image.getInstance. Its posible to color Tiff to pdf
> file using iText?
>       >
>       > Here is my code.
>       > tempFile = new File(finalPath);
>       > FileOutputStream fileOutputStream = new
> FileOutputStream(tempFile);
>       > byte[] read = new byte[input.available()];
>       >
>       > File cacheFile = new File(finalPath1);
>       > FileOutputStream bos = new FileOutputStream(cacheFile);
>       >
>       > ByteArrayOutputStream outfile = new ByteArrayOutputStream();
>       > Document document = new Document(PageSize.A4.rotate());
>       > PdfWriter writer = PdfWriter.getInstance(document, bos);
>       > writer.setStrictImageSequence(true);
>       > document.open();
>       > Image tiff = Image.getInstance(read);
>       > tiff.scaleToFit(800, 600);
>       > document.add(tiff);
>       > document.close();
>       > outfile.flush();
>       >
>       >
>       >
>       >
>       >
>       >
>       > On Mon, Oct 19, 2009 at 3:39 PM, Paulo Soares
>       > <psoares@...<mailto:psoares@...>> wrote:
>       >
>       >
>       >       Not only that, if you use a stream it's read to a byte
>       > array. Use a file
>       >       instead.
>       >
>       >       Paulo
>       >
>       >
>       >       ----- Original Message -----
>       >       From: "Mark Storer"
> <MStorer@...<mailto:MStorer@...>>
>       >       To: "Post all your questions about iText here"
>       >
> <itext-questions@...<mailto:itext-questions@...>>
>       >
>       >       Sent: Monday, October 19, 2009 9:24 PM
>       >       Subject: Re: [iText-questions] Help
>       >
>       >
>       >       Give the JVM more memory when you create it:
>       >
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
>       >
>       >       This has almost nothing to do with iText, and
>       > everything to do with Java.
>       >
>       >
>       >       --Mark Storer
>       >        Senior Software Engineer
>       >        Cardiff.com
>       >
>       >       #include <disclaimer>
>       >       typedef std::Disclaimer<Cardiff> DisCard;
>       >
>       >       -----Original Message-----
>       >       From: thulasi ram
> [mailto:pthulasiram@...<mailto:pthulasiram@...>]
>       >       Sent: Monday, October 19, 2009 11:15 AM
>       >       To:
> itext-questions@...<mailto:itext-questions@...>
>       >       Subject: [iText-questions] Help
>       >
>       >       Hi all,
>       >        I'm using iText Tiff2pdf method for converting Tiff to
>       > image pdf. I'm
>       >         getting "Outofmemory" error while converting large
>       > size (morethen 5MB)
>       >         images in the line of
>       >         ra = *new* RandomAccessFileOrArray(inStream);.
>       >         Can any one help how to create pdf for large
> size Tiff images.
>       >
>       >       Thanks,
>       >       Ram


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/