Note that there are some explanatory texts on larger screens.

plurals
  1. POnot getting Font effect in PDF when convert HTML To PDF file
    primarykey
    data
    text
    <p>Using this below Code i am Abel to convert a HTML text To PDF and my code can generate PDF File on particular location . but problem is...... i give font style in body tags so when PDF is generate i am not getting this font style effect in generate PDF ex.</p> <pre><code> // Here On Body Tag I have given a Zurich BT font style StyleSheet styles = new StyleSheet(); //styles.loadTagStyle("body", "font-family", "Zurich BT"); styles.loadTagStyle("body", "font", "Zurich BT"); </code></pre> <p><strong>so here my font style is Zurich BT but i have just got plane simple text on generate PDF not get any effect on text.</strong></p> <p><strong>i am using itextpdf-5.1.1 version and my code is....</strong></p> <pre><code> ByteArrayOutputStream baos = new ByteArrayOutputStream(); Document pdfDocument = new Document(); Reader htmlreader = new StringReader("&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;" + " &lt;font&gt; HELLO MY NAME IS JIMIT TANK &lt;/font&gt; &lt;/html&gt;&lt;/body&gt;"); PdfWriter.getInstance(pdfDocument, baos); pdfDocument.open(); // Here On Body Tag I am giving a Zurich BT font style StyleSheet styles = new StyleSheet(); //styles.loadTagStyle("body", "font-family", "Zurich BT"); styles.loadTagStyle("body", "font", "Zurich BT"); ArrayList arrayElementList = HTMLWorker.parseToList(htmlreader,styles); for (int i = 0; i &lt; arrayElementList.size(); ++i) { Element e = (Element) arrayElementList.get(i); pdfDocument.add(e); } pdfDocument.close(); byte[] bs = baos.toByteArray(); String pdfBase64 = Base64.encodeBytes(bs); //output File pdfFile = new File("c:/pdfExample.pdf"); FileOutputStream out = new FileOutputStream(pdfFile); out.write(bs); out.close(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload