合并PDF文件,并下载原创
金蝶云社区-云社区用户P1263956
云社区用户P1263956
5人赞赏了该文章 105次浏览 未经作者许可,禁止转载编辑于2024年04月18日 15:57:52

需要在NuGet 引入 GroupDocs.Merger


  string filePath = PathUtils.GetPhysicalPath(KeyConst.TEMPFILEPATH,fileName);//绝对地址

            string filePath2 = PathUtils.GetPhysicalPath(KeyConst.TEMPFILEPATH,fhtzfileName);

            string filePathOut = PathUtils.GetPhysicalPath(KeyConst.TEMPFILEPATH,"aaa.pdf");


          

            using (Merger merger = new Merger(filePath2))

            {

                merger.Join(filePath);

                merger.Save(filePathOut);

            }


            string _OutzipServicePath = PathUtils.GetServerPath(KeyConst.TEMPFILEPATH, "aaa");

            _OutzipServicePath += ".pdf";


           


            //下载文件

            DynamicFormShowParameter param = new DynamicFormShowParameter();

            param.FormId = "BOS_FileDownLoad";

            param.OpenStyle.ShowType = ShowType.Modal;

            param.CustomParams.Add("IsExportData", "true");

            param.CustomParams.Add("url", _OutzipServicePath);

           this.View.ShowForm(param);


赞 5