using iTextSharp.text;
using iTextSharp.text.html.simpleparser;
using iTextSharp.text.pdf;
using System;
using System.IO;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
// not: html'de dışsan width kullanılacaksa PX eklentisi yapmayınız!
// <table width="200px" ..... yerine <table width="200" veya <table style="width:200px" .....
//
var htmlText = @"<p>This <em>is </em><span class=""headline"" style=""text-decoration: underline;"">some</span> <strong>sample <em> text</em></strong><span style=""color: red;"">!!!</span></p>";
Document document = new Document(PageSize.A4.Rotate());
PdfWriter.GetInstance(document, new FileStream("C:/Users/murat/Desktop/New folder/1.pdf", FileMode.Create));
StringReader se = new StringReader(htmlText);
HTMLWorker obj = new HTMLWorker(document);
document.Open();
obj.Parse(se);
document.Close();
Console.WriteLine("ok");
Console.ReadLine();
}
}
}
------------- http://www.kasatakip.com - Kasa Takip | http://www.caritakip.com - Cari Takip | http://www.evraktakip.com - Evrak Takip | http://www.etasqlmobil.com - ETA SQL Mobil
|