Is there a way to convert a ps file with ghostscript on Windows without access to the command prompt (cmd)? - ghostscript

I hope that I find the right words to explain my problem. I want to convert an adobe illustrator file to png on a Windows machine where I have no admin rights, no Adobe Illustrator and no access to the cmd.
On my Ubuntu machine I can easily use something like
gs -dNOPAUSE -dBATCH -dEPSFitPage -sDEVICE=png16m -r600 -sOutputFile=test.png ai.ai
But on the Windows Machine I could only install Ghostscript 9.5, which starts into a GUI with a prompt that says "GS>". I never used that, so I just thought that I could write something like
-dNOPAUSE -dBATCH -dEPSFitPage -sDEVICE=png16m -r600 -sOutputFile=test.png ai.ai
But then I get only error messages and after some reading I found out that this interpreter is something different where people can put thinks on a stack or so. Can I somehow use this GS interpreter to do what my gs on the Linux machine did from the shell?
Best regards
Martin
PS: Windows 10 machine, whatelse do you need?

Related

Making Graphic Magick detect Ghostscript for reading pdf on Windows. How to change Ghostscript invocation name on WINDOWS CMD to 'gs'?

My OS is Windows 10. What I did for Ghostscript installation:
I installed Ghostscript (v9.53.3)
I added Ghostscript bin folder location to my environment PATH variable. (C:\Program Files\gs\gs9533\bin)
I restarted my machine.
After this step, my cmd is able to recognize "gswin64c" command. However, "gs" is not recognized. According to Ghostscript examples, the 'gs' command should work. What must I do to make "gs" command recognized? Should I be worried here?
Now, to my Graphics Magick Problem:
I am also using Graphic Magick v1.3.36 (GM) on my machine. My GM does not have the delegate for pdf format even after I installed Ghostscript as mentioned above. As seen in this error which shows every time I try to convert a pdf file to images using gm.
C:\program files\graphicsmagick-1.3.36-q16\gm.exe convert: No decode delegate for this image format (file1.pdf)
My suspicion is that the 'gs' command is not recognized in windows and this is causing GM to be unable to detect Ghostscript.
I would value any suggestion of how to make GM work with ghostscript on my windows machine. Thank you.
UPDATE (5th March 2021)
I found out that changing the command to gs for Ghostscript does not fix GM's pdf delegate problem -- GM still cannot detect Ghostscript!! My suspicion above is wrong.
I was struggling with "GM's pdf delegate problem" too. And I found out that GraphicsMagick uses the Ghostscript Fonts (also known as "URW Fonts") to support the standard set of Adobe Postscript fonts like "Helvetica" and "Times Roman".
Download fonts from here Ghostscript Fonts and paste downloaded folder fonts to the folder with Ghostscript files **C:Program Files\gs\gs9.27**. Here you could find more information.
After installing ghostscript and adding it's path to environment variables and checking it by running gswin64c command.
Update the delegates.mgk file present at C:\Program Files\GraphicsMagick-1.3.34-Q16
The delegates.mgk entry looks somewhat like this by default-
<delegate decode="pdf" encode="eps" mode="bi" command='"#PSDelegate#" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=#GSEPSDevice# "-sOutputFile=%o" -- "%i" -c quit' />
Note the #PSDelegate# env variable in the command, Just find and replace all the #PSDelegate# with the path gswin64c at all places. After this Graphic Magick will start delegating the tasks to Ghostscript.
Also there's a issue with Graphic Magick v1.3.36 for windows, as mentioned by one of the maintainers here
So try installing an older version.
A similar issue has been explained on this question as well.

Kivy Atlas Creation On Windows

Seems like Kivy APIs are steered towards Linux systems more than anything. Has anyone success created a kivy atlas on windows using the command prompt?
If so, how is it done?
Full working code please.
Actually this manual works on Windows. You need to use console (press Win+R, type cmd and press Enter).
cd to your project folder and use the following command (with your image filenames and sizes, obviously). And it's dir on Windows, not ls, but otherwise it's the same.
python -m kivy.atlas myatlas 256x256 img1.png img2.png
This simplest way under Windows for me was the following...
Create a script with a string template of the Json code which constructs the atlas.
ImgSize = 512x512
AtlasT = """
{
"run.png": {
%s
}
}
"""
You would then create a loop, that will loop through all directories you specify, gathering all the images and formatting the template.
Save the atlas at the end. All mathematics are calculated by the script based on the size of the images.
If you use the linux terminal command as per the docs, you'll get an error. Just enter this into windows commmand line window - python - m, and hit enter. You'll get an error saying python is not recognized as an external or internal command or something like that.
Linux Ubuntu is far different from Windows. It seems like Linux is always aware of what you install so if you address something by name like, python, you'll get feed back. That's not the same under Windows. In order to use python on windows you really have to point to python.exe.
Don't bother using the kivy docs atlas command line in windows. Windows won't understand kivy.atlas either. It's not Linux!

Window pops up when batch printing PDF with Ghostscript

I'm using GS 9.15 to batch print some PDF's on a windows machine. This is the command I'm using:
gswin64 -dNoCancel=true -dBATCH -dNOPAUSE -dNOSAFER -q -sDEVICE=ljet4d -sOutputFile=%printer%[printer path] "[pdf path]"
Although this works a window pops up during the print and then closes.
Any way to hide it?
Use gswin64c (command line version) instead of gswin64 (windowed version).

how to invoke fonts dir in ghostscript

I am trying to create a PDF out of a text file with Courier as font and trying to use gswin32c.exe on Windows, but unnable to pass parameters correctly, I think. The gswin32c.exe is the Windows exe of Ghostscript.
Here is my command:
gswin32c.exe -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sFONTPATH="C:\Temp\Fonts2\" -sOUTPUTFILE="C:\Temp\Outputfile.pdf" A1401227.TXT
I don't get a output file, why? How can I trigger the Font, pass the fonts dir?
Not getting an output file is nothign to do with the presence or absence of fonts.
You appear to be sending a text file to GS, which it can't handle (unless this is hand-crafted PostScript).
Most likely you are generating an error, but because you have specified -dBATCH the application exits immediately after displaying it, so you can't see it. Try it without that switch.

Dia command line not working on OSX

I've got a problem with using Dia from the command line on OSX 10.7.4. I downloaded and installed the OSX dmg from http://dia-installer.de/download/macosx.html I've been using it to create graphics for a paper and absolutely love it.
I'm using a makefile to call pdflatex, bibtex, and R so that that it will build everything from scratch if need be, but can't get Dia's command line to work.
I want to use the command line with -e and -t to export the graphics to a specific directory so that pdflatex can put them in the pdf. (http://dia-installer.de/doc/en/re01.html)
The problem that I'm running into is that anytime I call it from the terminal, it brings up the GUI. Even if I give move to /Applications/Dia.app/Content/Resources/bin/ and use the command "./dia -v". It gives me a bunch of errors about "Input method" and then shows the GUI.
I looked on the Dia FAQ and it has a lot of information for the Windows command line, but nothing for OSX.
I'm hoping that someone here has run into this before and knows how to get it to work.
Thanks in advance.

Resources