以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 关于PDF分割文件命名 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=160887) |
||||
-- 作者:hnguang -- 发布时间:2021/2/25 10:11:00 -- 关于PDF分割文件命名 如图,我有一个PDF,想在分割的时候按订单号重命名,现在我分割出来的话,都是最后一张的,不能做到一一对应
|
||||
-- 作者:hnguang -- 发布时间:2021/2/25 10:12:00 --
|
||||
-- 作者:有点蓝 -- 发布时间:2021/2/25 10:34:00 -- Dim cmd As New SQLCommand cmd.C cmd.CommandText="select 訂單號 from 國內訂單總表 where 訂單號>=\'" & e.Form.Controls("txt_dh1").text & "\' And 訂單號<=\'" & e.Form.Controls("txt_dh2").text & "\' group by 訂單號 order by 訂單號" Dim dt As DataTable = cmd.executereader Dim file As String = e.Form.Controls("TextBox1").text Dim Test As pdfSharp.pdf.PdfDocument = pdfSharp.pdf.IO.PdfReader.Open(file,pdfSharp.pdf.IO.PdfDocumentOpenMode.Import) \'读取Test1.pdf Dim name As String = System.IO.Path.GetFileNameWithoutExtension(file) For i As Integer = 0 To Test.PageCount - 1 Dim dr As DataRow = dt.datarows(i) Dim outputDocument As pdfSharp.pdf.PdfDocument = new pdfSharp.pdf.PdfDocument() outputDocument.Version = Test.Version outputDocument.Info.Title = String.Format("Page {0} of {1}", i + 1, Test.Info.Title) outputDocument.Info.Creator = Test.Info.Creator outputDocument.AddPage(Test.Pages(i)) outputDocument.Save(String.Format(ProjectPath & dr("訂單號") & ".pdf", name, i + 1)) Next |
||||
-- 作者:hnguang -- 发布时间:2021/2/25 10:39:00 -- 非常感谢 |