iTextSharp.text.html.simpleparser.StyleSheet.LoadStyle C# (CSharp) Method

LoadStyle() public method

public LoadStyle ( String style, Hashtable props ) : void
style String
props System.Collections.Hashtable
return void
        public void LoadStyle(String style, Hashtable props) {
            classMap[style.ToLower(System.Globalization.CultureInfo.InvariantCulture)] = props;
        }

Same methods

StyleSheet::LoadStyle ( String style, String key, String value ) : void

Usage Example

Esempio n. 1
0
    protected void btnGenPdf_Click(object sender, EventArgs e)
    {
        iTextSharp.text.html.simpleparser.StyleSheet styles = new iTextSharp.text.html.simpleparser.StyleSheet();
        styles.LoadStyle("Invoice-Wrp", "width", "1200px");
        Response.ContentType = "application/pdf";
        Response.AddHeader("content-disposition", "attachment;filename=PaymentInvoice.pdf");
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        StringWriter   sw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter(sw);

        this.Page.RenderControl(hw);
        StringReader sr         = new StringReader(sw.ToString());
        Document     pdfDoc     = new Document(PageSize.A4, 50f, 50f, 50f, 50f);
        HTMLWorker   htmlparser = new HTMLWorker(pdfDoc);

        PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
        pdfDoc.Open();
        htmlparser.Parse(sr);
        pdfDoc.Close();
        Response.Write(pdfDoc);
        Response.End();
    }
All Usage Examples Of iTextSharp.text.html.simpleparser.StyleSheet::LoadStyle