is there some kind of limitant when itext adds an image to a pdf document?,
i am making an application which uploads a GIF o JPG, and i am using itext
to create a dynamic PDF to show to the users what information has entered
and what image has been uploaded before all this data is saved within the
BD, some images are added to the pdf document, i have tried with different
sizes ,
this is the code that i made
public ActionForward toUpload(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws
IOException, ServletException
{
String destino="exito";
UploadForm upload=(UploadForm)form;
FormFile file = upload.getBim_imagen();
ActionForward forward = null;
InputStream input = null;
try
{
int fileSize = file.getFileSize();
String fileName = file.getFileName();
System.out.println(fileName);
input = file.getInputStream();
FileStorageDAO dao = DAOFactory.getFileStorageDAO();
dao.saveFile(fileName, input, fileSize,"01");
Document doc=new Document(new Rectangle(1024,768));
ByteArrayOutputStream out=new ByteArrayOutputStream();
PdfWriter writer=PdfWriter.getInstance(doc,out);
doc.open();
/*doc.add(new Paragraph("Verificando datos del balance"));
doc.add(new Paragraph(upload.getSer_codigo()));*/
Image img=Image.getInstance(file.getFileData());
//img.setAbsolutePosition(10,10);
doc.add(img);
doc.close();
response.setContentType("application/pdf");
response.setContentLength(out.size());
out.writeTo(response.getOutputStream());
response.getOutputStream().flush();
}
catch(Exception e)
{
System.out.println(e);
}
finally
{
if (input != null)
{
input.close();
}
file.destroy();
}
return mapping.findForward(destino);
}
_________________________________________________________________
MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions