pswrite | OS X / CUPS Backends
kandi X-RAY | pswrite Summary
kandi X-RAY | pswrite Summary
MacOS / CUPS Backends to Save PostScript and PDF to disk, using print queues. This repository currently holds the following files, which create print queues for CUPS-based systems, primarily macOS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pswrite
pswrite Key Features
pswrite Examples and Code Snippets
Community Discussions
Trending Discussions on pswrite
QUESTION
I want to preface this with the understanding that I am working with legacy code and thus I am having to live with less than ideal situations and am doing some quirky stuff because of that. Until I can get approval to rewrite, I will have to make due.
Context
Here is my situation. The application is a "simple" one in that it reports off of a SQL database. For better or for worse it builds its reports with postscript. It make use of Ghostscript dlls in which it has embedded into the application directory. Here is the kicker, it has been requested that I include SSIS reports whose output is already in PDF format. For compatibility sake, i need to convert these PDFs into postscript even though in most situations they will be converted right back to PDF later on. I know this is most likely bad design but there is certain functionality that requires this and it just is what it is for the time being. I am using GhostScript to handle the conversions.
Observed Behavior The following behavior is what is observed once the PDF is converted to PS, passed through the application, and then converted back to PDF.
When using the "sDevice=pswrite" everything works except that the reports are compiled with poor resolution despite how I tweek the resolution option.
When leveraging "sDevice=ps2write" which I understand to be the current accepted protocol, the PDF will not render back and produces the following error.
...ANSWER
Answered 2017-Oct-04 at 07:18To be honest, nobody is likely going to be able to help without seeing the original PDF file. Even a dummy file will be fine provided it exhibits the error.
However, the first thing that springs to mind is that you appear to be using Ghostscript 9.05. That is now 5 years old, the current release is (about to be) 9.22. There have been numerous fixes to ps2write in that time, at least 50 or more, and the first thing I would suggest you do is upgrade and see if the problem goes away.
Secondly, you haven't been clear on why you need to convert the PDF files to PostScript. If all you are doing is feeding those back through Ghostscript along with some additional PostScript in order to convert the assemblage into PDF, you do not need to turn the PDF files into into PostScript first. Ghostscript is entirely capable of taking a mixture of PDF and PostScript files, so you can simply inject the PDF in between the PostScript from your SQL output to produce a single combined PDF.
This has a number of advantages; first and most obviously, you shouldn't get your conversion problem. Secondly, any construct in the PDF file which cannot be represented in PostScript (eg transparency) means that the content will be rendered to an image and the PostScript will simply contain a big bitmap. Just like the pswrite output, avoiding conversion means that won't happen. Thirdly it will be quicker than first converting all the PDF files to PostScript.
If you absolutely can't do that, then I would try current code and see if its better. If not then you have found a bug and I would suggest you report it at https://bugs.ghostscript.com you will need to be able to supply an example file and command line though.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pswrite
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page