Support unmodified Xpdf binaries
Use stdout redirection scripts for pdfinfo and, on Windows, a script to run pdftotext hidden, which together allow for all unmodified binaries (including, probably, symlinked system ones, though I didn't test that). On Windows, using a .vbs does cause a brief wait cursor. The stock pdfinfo needs the redirection script anyway, so that's unavoidable, but on the async branch I think we'll be able to switch to pdf.js for the page count, at which point maybe I'll try to remember how I modified the Windows binaries to be hidden and use a modified version of pdftotext to avoid VBScript. (We use the stock pdftotext elsewhere already.)
This commit is contained in:
parent
aa7c1b6fd6
commit
a9ca6e0857
6 changed files with 267 additions and 133 deletions
24
resource/hide.vbs
Normal file
24
resource/hide.vbs
Normal file
|
@ -0,0 +1,24 @@
|
|||
Option Explicit
|
||||
|
||||
Dim WshShell, fso, exe, args, I
|
||||
|
||||
Set WshShell = Wscript.CreateObject("Wscript.Shell")
|
||||
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
If WScript.Arguments.Count = 0 Then
|
||||
WScript.Echo "Usage: hidden.vbs program.exe [args...]"
|
||||
WScript.Quit 1
|
||||
End If
|
||||
|
||||
exe = WScript.Arguments(0)
|
||||
If Not(fso.FileExists(exe)) Then
|
||||
WScript.Echo "Executable not found: " & exe
|
||||
WScript.Quit 1
|
||||
End If
|
||||
|
||||
args = ""
|
||||
For I = 1 to WScript.Arguments.Count - 1
|
||||
args = args & " " & chr(34) & WScript.Arguments(I) & chr(34)
|
||||
Next
|
||||
|
||||
WshShell.Run exe & args, 0, true
|
Loading…
Add table
Add a link
Reference in a new issue