Bruno,

I'm sorry. Now i'm writing to the correct place(itext-questions@lists.sourceforge.net).

 I new, very new in java. I'm at university yet.

I'm in a new work and i'm trying make a pdf from an html file. This file is simple, like your example at your page.

If i work using tables and text it's great...the problem are the image. I need that image (from url) inside the pdf file.

Please, where i'm wrong? Or i can't take an image from a http with itext?

THANK's IN ADVANCE.

Dany


This is my code :

         import java.io.StringReader;
        import java.io.FileOutputStream;

        import com.lowagie.text.*;
        import com.lowagie.text.Document;
        import com.lowagie.text.PageSize;
        import com.lowagie.text.pdf.PdfWriter;
        import com.lowagie.text.html.simpleparser.*;


public class LeioHTML {

                //private String conteudo;
                //private InputStream ba;
       
            public static void main(String[] args) {                
                     StringBuffer sBuff = new StringBuffer("<html>");
                     sBuff.append("<head></head>");
                     sBuff.append("<body encoding=\"utf-8\">");                                  
                     sBuff.append("<P>dpfspdofpskdfpokspdofkpaoskfpoasd</P>"+
"<P>fasdpfokapsdofkpoaskdfposkdfpoaksdpofka spdfkpoaskdf poksdpofkaposdkfa"+
"psdofka</P><P>apsdkfpoaskdfpokpsodkfa pokdsfpoaksdfpokasdpofkaposdfkpaosdkf"+
"poaskdfpoaksdpfokasdfpok</P><TABLE cellSpacing=\"1\" cellPadding=\"1\" width=\"75%\" border=\"1\">" +
"<TR><TD><TABLE cellSpacing=\"1\" cellPadding=\"1\" width=\"75%\" border=\"1\">" +
        "<TR><TD colSpan=\"3\">TB2TB2TB2</TD></TR><TR><TD>TB2</TD>" +
         "<TD>TB2</TD><TD>TB2</TD></TR><TR><TD>TB2</TD>" +
         "<TD>TB2</TD><TD>TB2</TD></TR></TABLE></TD><TD>TB1</TD>"+
    "<TD>TB1</TD></TR><TR><TD>TB1</TD><TD>TB1</TD><TD>TB1</TD></TR><TR>" +
    "<TD>TB1</TD><TD>TB1</TD><TD>TB1</TD></TR></TABLE>cvbcvbvcvbcvbcvb" +  
"<P>laksdkla dlkjasdlk adjlaksjd las</P><P>" +
"<TABLE cellSpacing=\"1\" cellPadding=\"1\" width=\"75%\" border=\"1\"><CAPTION>TabelaTeste</CAPTION>" +
  "<TR><TD colSpan=\"2\" Celula>TT</TD><TD Celula>TT</TD></TR><TR>" +
    "<TD Celula>TT</TD><TD Celula>TT</TD><TD Celula>TT</TD></TR><TR>" +
    "<TD Celula>TT</TD><TD colSpan=2 Celula>TT</TD></TR><TR><TD Celula>TT</TD>" +
    "<TD Celula>TT</TD><TD Celula>TT</TD></TR><TR> <TD Celula>TT</TD> <TD Celula>TT</TD>" +
    //"<TD Celula>TT</TD></TR></TABLE>cvbcvbcvbcvbcvbcvbcb</P><P><IMG SRC="" /></P>");
       
                     sBuff.append("</body>");
                     sBuff.append("</html>");
                     Document document = new Document(PageSize.A4, 80, 50, 30, 65);
                     HTMLWorker worker = new HTMLWorker(document);
                     StringReader stringReader = new StringReader(sBuff.toString());
                     try {
                             PdfWriter.getInstance(document, new FileOutputStream( args[0]));
                         document.open();
                         worker.parse(stringReader);
                         document.close();}
                     catch (Exception e1) {
                             e1.printStackTrace();
                     }                                    
               
            }
           
       
}



Bruno Lowagie <[EMAIL PROTECTED]>

02/09/2006 08:53

       
        Para:        [EMAIL PROTECTED]
        cc:        
        Assunto:        iText question



Please do not use the FAQ pages to post questions.
You are supposed to post ANSWERED QUESTIONS to the FAQ.
Questions without an answer should be sent to:
itext-questions@lists.sourceforge.net

As for your question: it is irrelevant for the iText FAQ.
It is an ordinary Java question.
Try accessing the file with plain Java objects, such as
java.io.File or java.net.URL and the same exception will
be thrown.

br,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to