• 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"));
        }
    }

  • 相关阅读:
    黑客技术(自学)——网络安全
    如何查询一组文件夹中的总字节数 (LINQ) (C#)
    【动手学深度学习】--循环神经网络
    安全性归约
    本地生活服务正在借助小程序迎战增量市场
    JDBC API详解
    深度学习 -- pytorch 计算图与动态图机制 autograd与逻辑回归模型
    Node.js环境搭建
    Java 数组
    【Spark】scala基础操作(持续更新)
  • 原文地址:https://blog.csdn.net/J_guangxin/article/details/134241394