Html,CSS字符串转换为PDF [英] Html, CSS string to PDF conversion

查看:111
本文介绍了Html,CSS字符串转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想转换由html&组成的字符串css into pdf。

我已经这样做了,我的问题是pdf不会在每个页面重复表头,我的客户想要这个。

我需要重复每个页面和每个页面末尾的表格标题都应该有正确的结束水平线。



我尝试过:



我试过thead {display:table-header-group;}

也尝试了不同的c#代码,但结果是一样的。

Hi All,
I want to convert a string made of html & css into pdf.
I have done that, My problem is that pdf doesn't repeat the table header in every page, my clients wants this.
I need to repeat table header in every page and at the end of every page, there should be proper ending horizontal line.

What I have tried:

I have tried thead{display: table-header-group;}
also tried different c# code but result was same.

推荐答案

如果您使用itextsharp生成PDF,并将PdfPTable添加到iTextSharp.text.Document

使用下面的行,这将创建标题行生成PDF时的每一页

If you are using itextsharp to generate PDF, and adding PdfPTable to iTextSharp.text.Document
Use below line, this will create header row on each page while generating PDF
PdfPTable.HeaderRows = 1;


这篇关于Html,CSS字符串转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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