0

iTextSharpを使用してpdfファイルを作成しています。

ただし、ソース HTML でリンクされている外部 CSS は PDF には表示されません。

iTextSharp が正しくレンダリングされるように、外部 css ファイルを含めるにはどうすればよいですか?

Dim doc As Document = New Document 
PdfWriter.GetInstance(doc, New FileStream(Request.PhysicalApplicationPath + _ 
                                          "\ListingDetails.pdf", FileMode.Create)) 

Dim content As String = File.ReadAllText(Server.MapPath("~/PDFPage.aspx")) 

doc.Open() 

Dim parsedHtmlElements = HTMLWorker.ParseToList(New StringReader(content), Nothing) 

For Each htmlElement As Object In parsedHtmlElements 
   doc.Add(TryCast(htmlElement, IElement)) 
Next 

doc.Close()
4

0 に答える 0