- 1 year ago
How to append output file name using input file name without extention while using ghostscript?
Comment
1 / 1
To append the output file name with the input file name (without the extension) when using Ghostscript, you can use the following command-line options:
bashgs -sDEVICE=... -o "output_%s.pdf" -f "input.pdf"
Here's an explanation of the options:
-sDEVICE=...
: Specifies the output device or format. Replace...
with the desired device or format, such aspdfwrite
for PDF output.-o "output_%s.pdf"
: Sets the output file name pattern.%s
will be replaced with the base name of the input file (without the extension). In this example, the output file name will be in the format "output_input.pdf" where "input" is the base name of the input file.-f "input.pdf"
: Specifies the input file name.
Make sure to adjust the file names and paths to match your specific environment and requirements.