我在pdftk中遇到了这个问题 [英] I'm getting this issue in pdftk

查看:240
本文介绍了我在pdftk中遇到了这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:无法打开文件



错误:无法打开PDF文件



输入错误,所以没有创建输出。



我尝试过:



我的代码:

input =C:\ Users \sathishr \Desktop \Small \ a_20160310 _ *。pdf

output =C:\用户\ atathrhr \Desktop \Small \Test_US.pdf

MergePdf(输入,输出)



Private Sub MergePdf( ByVal InputFileNames As Object,ByVal OutputFileName As Object)

尝试

'合并生成的pdf文件



Dim oProcess As New System.Diagnostics.Process

oProcess.StartInfo.FileName =pdftk

oProcess.StartInfo.Arguments = InputFileNames +output+ OutputFileName

oProcess.Start()

oProcess.WaitForExit()

oProcess.Clo se()

Catch ex As Exception

抛出ex

结束尝试

结束Sub

Error: unable to open file

Error: Failed to open PDF File

Input Error, so no output created.

What I have tried:

My Code:
input = "C:\Users\sathishr\Desktop\Small\a_20160310_*.pdf"
output = "C:\Users\sathishr\Desktop\Small\Test_US.pdf"
MergePdf(input, output)

Private Sub MergePdf(ByVal InputFileNames As Object, ByVal OutputFileName As Object)
Try
'Merging the generated pdf files

Dim oProcess As New System.Diagnostics.Process
oProcess.StartInfo.FileName = "pdftk"
oProcess.StartInfo.Arguments = InputFileNames + "output" + OutputFileName
oProcess.Start()
oProcess.WaitForExit()
oProcess.Close()
Catch ex As Exception
Throw ex
End Try
End Sub

推荐答案

问题似乎在
oProcess.StartInfo.Arguments = InputFileNames + "output" + OutputFileName



argumentsAFAIK中没有空格,pdftk的正确语法是


There are no spaces in the argumentsAFAIK the correct syntax for pdftk would be

pdftk C:\Users\sathishr\Desktop\Small\a_20160310_*.pdf cat output C:\Users\sathishr\Desktop\Small\Test_US.pdf

所以我认为该行应该是(注意未经测试)

so I think that line should be (note untested)

oProcess.StartInfo.Arguments = InputFileNames + " cat output " + OutputFileName


这篇关于我在pdftk中遇到了这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆