Bug 695039 - Unable to create OUTPUTFILE Using Surface Table with Windows 8.1
Summary: Unable to create OUTPUTFILE Using Surface Table with Windows 8.1
Status: RESOLVED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Build Process (show other bugs)
Version: 9.10
Hardware: PC Windows 8
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 09:19 UTC by Vic Spainhower
Modified: 2016-03-05 13:29 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vic Spainhower 2014-02-13 09:19:19 UTC
I'm developing a vb.net application that creates a PDF using Crystal Reports and then merges other miscellaneous PDF files with it creating a single file.  This works perfectly fine using Windows. It has also been working fine for several years in the VB6 version of the application.

The problem is when I run the app on a MS Surface tablet with Windows 8.1 installed I'm receiving an error from the App that it cannot find the output file.

When running Ghostscript from a command prompt I get the error:

GPL Ghostscript 9.10:  **** Could not open temporary file ''
**** Unable to open the initial device, quitting.

The same command file runs fine on a Windows 7 machine.

gswin32c -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=c:\MyTemp\Merged.pdf -dBATCH "C:\MyTemp\T0000.PDF" "C:\MyTemp\T0001.pdf" "C:\MyTemp\T0002.pdf" "C:\MyTemp\T0003.pdf" "C:\MyTemp\T0004.pdf" "C:\MyTemp\T0005.pdf" "C:\MyTemp\T0006.pdf" "C:\MyTemp\T0007.pdf" "C:\MyTemp\T0008.pdf" "C:\MyTemp\T0009.pdf" "C:\MyTemp\T0010.pdf" "C:\MyTemp\T0011.pdf" "C:\MyTemp\T0012.pdf" "C:\MyTemp\T0013.pdf" "C:\MyTemp\T0014.pdf" "C:\MyTemp\T0015.pdf" "C:\MyTemp\T0016.pdf" "C:\MyTemp\T0017.pdf" 

Thanks,

Vic
Comment 1 Vic Spainhower 2014-02-13 11:33:10 UTC
If I remove -sDEVICE=pdfwrite the merge does complete but of course the output is directed to the screen and I need it to create a pdf file.
Comment 2 Chris Liddell (chrisl) 2014-02-13 13:25:12 UTC
If you're referencing gswin32c.exe, I assume you're using an x86 based Surface (Pro, I believe)?
Comment 3 Ken Sharp 2014-02-13 13:49:03 UTC
The error message says 'Could not open temporary file' so I don't believe its anything to so with the output file.

The first thing I would try doing in your place is reducing the complexity of the command line, instead of trying to run 17 files, try just 1.

Note that the switch should be -sOutputFile=, its case sensitive so -sOUTPUTFILE shouldn't work. You should correct that too.

Then you can try changing the location of temporary files, see:

gs/doc/Use.htm#Temp_files

Ghostscript is known to work with Windows 8, at least on a desktop machine, its possible there is some kind of permissions problem on a Surface device, I don't have one so I couldn't really say.
Comment 4 Ray Johnston 2014-02-13 17:30:08 UTC
Just a note, in gs_init.ps there is code to accept OUTPUTFILE as an alias for
OutputFile:

currentdict /OUTPUTFILE known	% obsolete
 { /OutputFile /OUTPUTFILE load def
   currentdict /OUTPUTFILE .undef
 } if

It is commented as obsolete, so only -sOutputFile should be used.

The alias is not supported with other parsers, e.g. pcl, xps, ...
Comment 5 Vic Spainhower 2014-02-14 05:33:33 UTC
(In reply to comment #3)
> The error message says 'Could not open temporary file' so I don't believe
> its anything to so with the output file.
> 
> The first thing I would try doing in your place is reducing the complexity
> of the command line, instead of trying to run 17 files, try just 1.
> 
> Note that the switch should be -sOutputFile=, its case sensitive so
> -sOUTPUTFILE shouldn't work. You should correct that too.
> 
> Then you can try changing the location of temporary files, see:
> 
> gs/doc/Use.htm#Temp_files
> 
> Ghostscript is known to work with Windows 8, at least on a desktop machine,
> its possible there is some kind of permissions problem on a Surface device,
> I don't have one so I couldn't really say.

Ken, Per your suggestion the command is now: 

gswin32c -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=C:\MyTemp\Merged.pdf -dBATCH "C:\MyTemp\T0000.PDF" 

and I am receiving the same error. I don't think it's a permissions error because the app is creating all of the files for the combine process. I'll read how to change the locagtion of temp files and see if that helps.

This is a Surface PRO machine.

Thanks,

Vic
Comment 6 Vic Spainhower 2014-02-14 05:51:02 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > The error message says 'Could not open temporary file' so I don't believe
> > its anything to so with the output file.
> > 
> > The first thing I would try doing in your place is reducing the complexity
> > of the command line, instead of trying to run 17 files, try just 1.
> > 
> > Note that the switch should be -sOutputFile=, its case sensitive so
> > -sOUTPUTFILE shouldn't work. You should correct that too.
> > 
> > Then you can try changing the location of temporary files, see:
> > 
> > gs/doc/Use.htm#Temp_files
> > 
> > Ghostscript is known to work with Windows 8, at least on a desktop machine,
> > its possible there is some kind of permissions problem on a Surface device,
> > I don't have one so I couldn't really say.
> 
> Ken, Per your suggestion the command is now: 
> 
> gswin32c -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=C:\MyTemp\Merged.pdf
> -dBATCH "C:\MyTemp\T0000.PDF" 
> 
> and I am receiving the same error. I don't think it's a permissions error
> because the app is creating all of the files for the combine process. I'll
> read how to change the locagtion of temp files and see if that helps.
> 
> This is a Surface PRO machine.
> 
> Thanks,
> 
> Vic


I set the Environment Variables TEMP and TMP to C:\MyTemp\GSTemp but that did not help.
Comment 7 Ken Sharp 2014-02-14 05:59:21 UTC
I am at a loss for further suggestions. I don't have a surface device of any kind, and I don't have a copy of Windows 8.1, only Windows 8.

On a Windows 8 desktop PC the Ghostscript executable works for me.
Comment 8 Vic Spainhower 2014-02-14 06:14:41 UTC
(In reply to comment #7)
> I am at a loss for further suggestions. I don't have a surface device of any
> kind, and I don't have a copy of Windows 8.1, only Windows 8.
> 
> On a Windows 8 desktop PC the Ghostscript executable works for me.

OK Problem Solved -

I set the environment variables TEMP and TMP to %USERPROFILE%\AppData\Local\Temp

and successfully combined all 17 files.

Thanks Ken and all others who took the time to read and respond to this message.


Vic
Comment 9 Chris Liddell (chrisl) 2014-02-14 06:21:56 UTC
(In reply to comment #8)
> 
> OK Problem Solved -
> 
> I set the environment variables TEMP and TMP to
> %USERPROFILE%\AppData\Local\Temp
> 
> and successfully combined all 17 files.


Hah, I had just typed up a reply asking you to try that! Thanks for confirming it works.

Glad it's resolved.

I'm going to leave this open for a while, at least, it seems to me there's argument that we should change our default temp directory, at least for newer Windows variants.
Comment 10 Chris Liddell (chrisl) 2016-03-05 13:29:40 UTC
I believe we are making every reasonable effort to find a sane temporary directory on Windows.

And there is, as confirmed above, a solution for installation specific issues.