예제 #1
0
        public static void Convert2()
        {
            HtmlToPdfConverter converter = new HtmlToPdfConverter();

            //Define the css for the html content
            converter.DefaultStyleSheet = ".para{font-size: 24px; color: #FF0000;}";

            string htmlContent = "<p class=\"para\">Content with special style.</p><p>Content without style</p>";

            converter.Load(htmlContent);

            //Choose pdf compliance level, PDF or PDF/A
            converter.PdfStandard = PdfStandard.Pdf;

            File.WriteAllBytes("convert.pdf", converter.SaveAsBytes());
        }