Foxtable(狐表)用户栏目专家坐堂 → 关于PDF分割文件命名


  共有2628人关注过本帖树形打印复制链接

主题:关于PDF分割文件命名

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111420 积分:567176 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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


 回到顶部