[softwarelist] Re: Potential TransPDF improvements

  • From: Peter Newble <peter@xxxxxxxxxx>
  • To: davidpilling@xxxxxxxxxxxxx
  • Date: Fri, 25 Jan 2019 13:21:34 +0000

On 25 Jan 2019, at 12:29, David Pilling <david@xxxxxxxxxxxxxxxx> wrote:


Here is an example:

Thanks. Your previous e-mail got me thinking (which is some achievement) — 
thank you. I found those registry keys and altered the one for TransPDF to 
point to a batch file saved to the same directory as the filter .exe files. It 
appears that the filter is called with two arguments: the full path of the 
input PDF and the output directory into which the EPS (presumably with the same 
name) is to be put.

So I have the following batch file to make the preview and EPS separately from 
the PDF as temporary files then combine them, saving the resulting EPS in the 
specified directory. It works fine when run as as a shell command, e.g. 
TransPDF filename.pdf outputdirectory, to create the file 
outputdirectory\filename.eps:

if exist C:\Temp.tif del C:\Temp.tif
if exist C:\Temp.eps del C:\Temp.eps

"C:\Program Files\gs\gs9.26\bin\gswin32c.exe" -dSAFER -dBATCH -dNOPAUSE 
-sDEVICE=eps2write -sOutputFile=C:\Temp.eps -r600 -q -dFirstPage=1 -dLastPage=1 
"%1"
"C:\Program Files\ImageMagick-7.0.1-Q8\convert.exe" "%1" -density 300 -depth 8 
-type TrueColorMatte C:\Temp.tif

if not exist %2\ mkdir %2
"C:\Program Files\epstool-3.09\bin\epstool.exe" --add-user-preview C:\Temp.tif 
C:\Temp.eps "%2\%~n1.eps"

if exist C:\Temp.tif del C:\Temp.tif
if exist C:\Temp.eps del C:\Temp.eps

The problem is that, when invoked from Ovation Pro by dropping a PDF into a 
frame, it fails with the error

Access is denied.
(CreateFile) (5) (C:\Users\PCN\AppData\Local\Temp\Ovation0\F01)

I have confirmed that the second argument being supplied to TransPDF in this 
case is indeed C:\Users\PCN\AppData\Local\Temp\Ovation0\F01. The error didn’t 
surprise me much since AppData is a read-only hidden folder. I therefore 
changed its permissions and TransPDF now works fine as a standalone command 
when given the same two parameters that Ovation Pro is passing it, but it still 
doesn’t work when Ovation Pro invokes the same command to import the same PDF.

I must be missing something obvious. Currently at the 
banging-head-against-the-wall stage . . .


Peter.

Other related posts: