本文实例讲述了C#使用iTextSharp设置PDF所有页面背景图功能的方法。分享给大家供大家参考。具体如下:
在生成PDF 的时候,虽然可以在页面中设置背景图。
但有些内容过长夸页面的时候,就很难设置背景图,变成了空白背景的页面!
以下是重新生成每一页 PDF 背景图功能代码!
public void SetPdfBackground(string pdfFilePath)
{
//重新生成的 PDF 的路径
string destFile = HttpContext.Current.Server.MapPath("sample.pdf");
//create new pdf