on 03-02-2010 5:02 AM
Hi All,
I am trying to create a PDF using a toolbar script and iText libraries.
I need to convert an MSA to a PDF.
What I want to know is that after the PDF is created, how can I auto open it in IE without human intervention.
Any pointers shall be highly appreciated.
Regards,
Himanshu
Hello,Expert,
we tried creating the PDF using the following script, and got an error. Could you please give me some adviece about it!!
Many thinks..
the Script is:
para = new Paragraph("asdsadsdsadsadas");
Document doc1 = new Document();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PdfWriter.getInstance(doc1,bos);
doc1.open();
doc1.add(para );
doc1.close();
FileInputStream nos = new FileInputStream(bos);
//newAttachment = TypeFactory.createAttachment();
//newAttachment.setFileData("Vendor Admit Certificate",nos,doc,session);
The Error Message is:
Typed variable declaration : Constructor error: Can't find constructor:
java.io.FileInputStream( java.io.ByteArrayOutputStream ) in class: java.io.FileInputStream
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Himanshu,
Were you able to make this work?
We are trying to either attach the PDF into the document or open it in IE, when the toolbar script is clicked.
Do you have any suggestions?
Thanks & Regards,
Reshma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For your reference, we tried creating the PDF using the following script, and got an error :
import java.io.*;
import com.itestpackage.text.*;
import com.itextpackage.text.pdf.*;
static String para = "test data";
Document doc = new Document ();
PdfWriter.getInstance (doc, new FileOutputStream ("descent.pdf"));
doc.open ();
Paragraph p = new Paragraph (para);
p.setAlignment (Element.ALIGN_JUSTIFIED);
doc.add (p);
doc.close ();
But we get an error on the new Document();
Could you help us with this?
Thanks & Regards,
Reshma
Hi HImanshu,
We corrected the problem we were facing earlier. It was because we were using a version of IText not compatible with our system. We used a lower version and it is now able to recognise the type 'Document'.
The error we now face is in converting the PDF into a Bytestream recognised by the attachment type of E-Sourcing.
I would really appreciate it if you could help with this.
Thanks & Regards,
Reshma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.