开发者

.NET version or port of Flying Saucer

开发者 https://www.devze.com 2022-12-31 05:39 出处:网络
Is there any open source .NET project (or port) 开发者_运维技巧similar to the Flying Saucer project which renders HTML to PDF using iText?I always recommend wkHTMLtoPDF for web->PDF conversions.It\'s

Is there any open source .NET project (or port) 开发者_运维技巧similar to the Flying Saucer project which renders HTML to PDF using iText?


I always recommend wkHTMLtoPDF for web->PDF conversions. It's web kit based though I'm not sure what PDF library it's sitting on.

At any rate, you'll be hard pressed to find something that will render your HTML more accurately (it'll even run script, set innerHtml and so forth).


For a quick-and-dirty solution you could try using IKVM to compile the Java to .NET.

http://www.ikvm.net/


Use the Pechkin .NET wrapper for WkHtmlToPdf. The resulting pdf can be outputted as a byte[], filestream or file path.

The NuGet package had a problem so I downloaded it directly from github and it seems to be working now.


wkHTMLtoPDF is based on WebKit so shares limitations - most importantly for common requirements in converting HTML to PDF as of this date WebKit cannot repeat table headers and footers across pages sans hacks and it does not look like this is going to change any time soon.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号