Skip to content

Invoking Ghostscript on different systems #4

@haakym

Description

@haakym

The method of invoking Ghostscript can vary on systems, e.g. Windows vs. Linux. As mentioned in the docs:

The command line to invoke Ghostscript is essentially the same on all systems, although the name of the executable program itself may differ among systems

In my situation, when using Ghostscript on Windows 7 64-bit there are two available executables:

  1. gswin64 - opens a new type-in window
  2. gswin64c - runs commands in the console

So gswin64c is what I want to use in combination with my PHP applications.

In Xthiago\PDFVersionConverter\Converter\GhostscriptConverterCommand the method of invoking Ghostscript is gs, however, when running this on my system it won't work and I get the expected error:

RuntimeException: 'gs' is not recognized as an internal or external command, operable program or batch file.

I'm guessing the quick solution is to rename the Ghostscript executable from gswin64c to gs, but would you consider some modifications to the pdf-version-converter package to either allow the user to modify the name of the executable (via some form of config?) or perhaps even by detecting the environment (overkill maybe?) or perhaps something simpler?

I'd be happy to submit a PR for this but would appreciate any thoughts/guidance first on how this should be dealt with even though I imagine this probably affects a small minority of users.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions