使用iTextSharp HTMLWorker在HTML中设置新页面(html到pdf) [英] set new page in HTML using iTextSharp HTMLWorker (html to pdf)

查看:259
本文介绍了使用iTextSharp HTMLWorker在HTML中设置新页面(html到pdf)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用iTextSharp(V 5.4.2.0)将html页面转换为pdf。但我希望能够设置一个新页面。



我试过这个:

 < div style =page-break-before:always>& nbsp;< / div> 

和标记< newpage />



但它不起作用。
创建一个html页面的最佳方式是什么,包括新的页面标签(或其他东西)能够使用iTextSharp正确转换它?



亲切的问候,

Matthijs

解决方案

使用iTextSharp XML Worker库,然后使用以下HTML:

 < div style =page-break-before:always>& nbsp;< / div> 


I using iTextSharp (V 5.4.2.0) to convert a html page to pdf. But I would like to be able to set a new page.

I've tried this:

<div style="page-break-before:always">&nbsp;</div>

and the tag <newpage />

But it doesn't work. What is the best way, to create a html page, including new page tags (or something) to be able to convert it correctly using iTextSharp?

Kind regards,

Matthijs

解决方案

Use the iTextSharp XML Worker library and then use this HTML:

<div style="page-break-before:always">&nbsp;</div>

这篇关于使用iTextSharp HTMLWorker在HTML中设置新页面(html到pdf)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆