Package com.lowagie.text.html.simpleparser

Examples of com.lowagie.text.html.simpleparser.StyleSheet


  public void addElementFromRtf(Phrase target, String rtfData, Font font) {
    String htmlStyle = rtfData;
    String htmlStr = rtfData.replace("LINE-HEIGHT: normal;", "");/*.replaceAll("style=\".*?\"", "")*/;
    try {     
      if (rtfData != null && !rtfData.isEmpty()) {
        StyleSheet styles = new StyleSheet();
        List<Element> elist =  HTMLWorker.parseToList(new StringReader(htmlStr), styles);
        for (Element element : elist) {
          if (element instanceof Paragraph) {
            if (font != null) {
              ArrayList<Chunk> cList = ((Paragraph) element).getChunks();
View Full Code Here


  }
 
  public void addHtmlToPdfContentByte(String html, float[] pos) {
   
    PdfContentByte cb = docWriter.getDirectContent();
    StyleSheet styles = createDefaultStyleSheet();

    ColumnText ct = new ColumnText(cb);
    ct.setSimpleColumn(pos[0], pos[1], pos[2], pos[3]);
    ct.setYLine(pos[3]);
    try {
View Full Code Here

      throw new RuntimeException("Could not parse HTML", e);
    }
  }
 
  private StyleSheet createDefaultStyleSheet() {
    StyleSheet styles = new StyleSheet();

//    styles.loadTagStyle("ul", "face", "Times");
//    styles.loadTagStyle("ul", "size", "25px");
//    styles.loadTagStyle("ul", "leading", "15f");
//    styles.loadTagStyle("ul", "list-style-type", "square");
View Full Code Here

   /**
    * XXX - this needs some work
    */
   private StyleSheet getStyle()
   {
      StyleSheet styles = new StyleSheet();
      styles.loadTagStyle("body", "leading", "16,0");
      return styles;
   }
View Full Code Here

TOP

Related Classes of com.lowagie.text.html.simpleparser.StyleSheet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.