ASP.net C# 用Aspose.pdf实现pdf合并

直接上代码,供参考,备忘!

using System;

using System.Collections.Generic;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

using System.Data.SqlClient;

using System.Xml;

using System.IO;

using Aspose.Pdf;

public partial class gxcx_Default : System.Web.UI.Page

{

protected void dyall_Click(object sender, EventArgs e)

{

int x=0;

Document doc, doc1;

doc = new Document();

string djbh;

foreach (GridViewRow gvr in this.grid.Rows)

{

if (gvr.RowType == DataControlRowType.DataRow)

{

var cb1 = (CheckBox)gvr.FindControl("CheckBox1");

if (cb1.Checked == true)

{

djbh = gvr.Cells[0].Text;

if (!getpdf(djbh))

continue;

if(x==0)

{

doc= new Document(Server.MapPath("spd.pdf"));

x++;

}

else

{

doc1 = new Document(Server.MapPath("spd.pdf"));

doc.Pages.Add(doc1.Pages);

}

}

}

}

doc.Save(Server.MapPath("spd1.pdf"));

}

}

相关推荐
yivifu16 分钟前
使用PyMuPDF基于对PDF文档内容的分析自动识别并删除PDF文件中的水印
python·pdf·pymupdf·去水印
我是唐青枫33 分钟前
C#.NET YARP 详解:用 ASP.NET Core 打造高性能反向代理网关
c#·.net
tanis_207733 分钟前
PDF 解析后输出什么格式?MinerU 五类下游场景的选型指南
人工智能·pdf·csdn开发云
火星papa10 小时前
C# 阻塞队列(BlockingCollection)
c#·queue·阻塞队列
tanis_207710 小时前
扫描版中文 PDF 怎么提取文字:用 MinerU 做 OCR + 结构化一体处理
人工智能·pdf·ocr
tanis_207713 小时前
MinerU2.5-Pro 中文 PDF 识别准确率全解:OmniDocBench v1.6 权威基准数据
人工智能·python·pdf
OctShop大型商城源码15 小时前
.NET线上商城源码_C#商城源码_技术赋能下的电商新生态
开发语言·c#·.net·商城系统源码
小林敲代码778817 小时前
基于 PDFBox 的 PDF 水印管理:使用 OCG 层实现精准添加与一键去除
pdf
hixiong12317 小时前
C#文件目录结构生成工具
开发语言·c#
tanis_207719 小时前
学术论文 PDF 的版面自动还原:MinerU 对多栏排版、浮动图表与脚注区域的识别实战
人工智能·pdf·ocr