Hi,
I have an application that convert an inputSteam to pdf. Below is the
content of the method that converts input stream to pdf. However, the
application suddenly stopped on line "*RandomAccessFileOrArray ra = new
RandomAccessFileOrArray(inputStream);" *without throwing any error or
exception which is kind of weird. Is it a known bug, can you give some
solution for this?? Thank you.. Badly needed. Please help
Code Content >>>>
ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
try
{
Document document = new Document(PageSize.A4);
PdfWriter.getInstance(document, baosPDF);
log.info("Document.open");
document.open();
*RandomAccessFileOrArray ra = new RandomAccessFileOrArray(inputStream);*
int pages = TiffImage.getNumberOfPages(ra);
for(int i = 1; i <= pages; i++){
Image img = TiffImage.getTiffImage(ra, i);
if((img.getScaledWidth() > 525) || (img.getScaledHeight() > 800))
{
img.scaleToFit(525, 800);
}
document.add(img);
}
document.close();
}
catch (DocumentException de)
{
log.error(de.getMessage());
throw de;
}
catch (IOException ioe)
{
log.error(ioe.getMessage());
throw ioe;
}
catch (Exception ex){
log.error(ex.getMessage());
throw ex;
}
return baosPDF;
--
Joed G. Cueto
Software Engineer, Java Practice
Business: +632 814 1100
Email: joed.cu...@pointwest.com.ph
Website: www.pointwest.com.ph
Pointwest Technologies Corporation
[image: Pointwest Logo]
12/F Citibank Center, 8741 Paseo de Roxas, Makati City, PH 1226
CONFIDENTIALITY NOTICE: This email may contain confidential and privileged
material for the sole use of the intended recipient(s). Any review, use,
distribution or disclosure by others is strictly prohibited. If you have
received this communication in error, please notify the sender immediately
by e-mail and delete the message and any file attachments from your
computer. There is no warranty that this email is error, virus or defect
free. If this is a private communication it does not represent the views of
Pointwest Technologies Corporation or their related entities.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php