1
我使用iTextSharp的HTML轉換爲PDF但我有與造型的問題。iTextSharp的外部樣式表
我使用iTextSharp的版本5和我能夠使用下面的代碼樣式標籤:
List<IElement> objects = HTMLWorker.ParseToList(new StringReader(htmlText), styles);
我的問題是:
StyleSheet styles = new StyleSheet();
styles.LoadTagStyle(HtmlTags.H1, HtmlTags.FONTSIZE, "16");
styles.LoadTagStyle(HtmlTags.P, HtmlTags.FONTSIZE, "10");
然後我用這個解析HTML和樣式表我可以導入外部樣式表而不必單獨指定每個標籤嗎?
我發現在早期的帖子驗證碼:
builder.ImportStylesheet(Request.PhysicalApplicationPath + "CSS\\Stylesheet.css");
,但我似乎無法得到這個工作,這是從iTextSharp的的舊版本已被取出的最新版本?
鏈接似乎已經死了,現在:( – Beta033 2013-01-22 20:47:25
https://code.google.com/p/proinfo-web/source /browse/trunk/HtmlToPdfBuilder.2.0.cs – 2014-02-19 08:43:31