hi,
i have written simple code using the HTML , where i m using the HTML Special Character ' which is " ' " (Single Quote ) character.
i have written simple code using the HTML , where i m using the HTML Special Character ' which is " ' " (Single Quote ) character.
but it is not converting that HTML Code to its Symbol.
do i need to do any other settings for that.
it is urgent
Regds
Sunil Rajput
import java.io.FileOutputStream;
import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.html.HtmlParser;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import com.lowagie.text.html.simpleparser.*;
import java.util.*;
import java.io.*;
public class Test {
public static void main(String[] args) {
Test test = new Test();
try {
test.createUsingString();
}catch (Exception e){
}
}
public void createUsingString() {
try {
StringBuffer sBuff = new StringBuffer("<HTML>");
sBuff.append("<head></head>");
sBuff.append("<body>");
sBuff.append("<table>");
sBuff.append("<tr><td>>This is HTML Code For Special Symbol ' ---> '</td></tr>");
sBuff.append("</table>");
sBuff.append("</body>");
sBuff.append("</html>");
StringReader stringReader = new StringReader(sBuff.toString());
Document document = new Document(PageSize.LEGAL,36,36,36,36);
OutputStream output = new
FileOutputStream("d:/itext/TestString1.pdf");
PdfWriter writer = PdfWriter.getInstance(document, output);
document.open();
HTMLWorker worker = new HTMLWorker(document);
worker.parse(stringReader);
document.close();
}catch (Exception ex){
System.out.println( "Exception " + ex.toString());
}
}
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
