The pswrite device uses gdev_vector_open_file_options to open the output file, which calls gx_device_open_output_file. The allows the use of special output files such as "%pipe%lpr" or on Windows "%printer%Queue Name". When pswrite closes, it calls gdev_vector_close_file, which simply calls fclose. It should instead close gx_device_close_output_file. This means that special closing code is not run. This is blocking my fix for Bug 687542. So it appears that gdevvec.c:808 should instead call gx_device_close_output_file((gx_device *)vdev, vdev->fname, f) as is done in gdevprn.c. Is this the correct fix?
pdfwrite, being a vector device, considers the output file as a positionable one. It won't work with a pipe.
It works with pdfwrite for simple files! The main requirement here is for use with pswrite. To print PDF files it is common to convert to PS with pswrite then send to a PS printer. Apart from the pipe issue, does the proposed change look correct? Any other unexpected side effects?
This change looks valid. Igor's comment about the pdfwrite device requiring a 'seekable' file is not relevant since this is supposed to be taken into account by the caller to gdev_vector_open_file_options setting the VECTOR_OPEN_FILE_SEQUENTIAL in the open_options.
This change looks valid. Igor's comment about the pdfwrite device requiring a 'seekable' file is not relevant since this is supposed to be taken into account by the caller to gdev_vector_open_file_options setting the VECTOR_OPEN_FILE_SEQUENTIAL in the open_options. Since gdevpdf.c uses gdev_vector_open_file which has the default options all 0, the file will be required to be seekable (since VECTOR_OPEN_FILE_SEQUENTIAL and VECTOR_OPEN_FILE_SEQUENTIAL_OK are false)