1T3XT info wrote:
> starmahrshi wrote:
>> i am using this code for generate pdf.
> 
> I don't like your code. I really don't.
> It needs to be rewritten.

Throw away your complete code sample and replace it with this:

public static byte[] createSimplePdf() {
   try{
     Document document = new Document();
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     PdfWriter writer = PdfWriter.getInstance(document, baos);
     writer.setPdfVersion(PdfWriter.VERSION_1_7);
     document.open();
     document.add(
       new Paragraph("Moksha Digital Software Private Limited"));
     document.close();
     return baos.toByteArray();
   } catch(DocumentException e){
     return null;
   }
}

I've tested it with Adobe reader 9 and it works.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to