Another shell issue/question
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
Another shell issue/question
My updated macro is as follows:
VAR_A=Request("path")
VAR_B=Request("fname")
FileSaveAs(1,"VAR_AVAR_B.grf")
FileSaveAs("Graphics Interchange Format","VAR_AVAR_B.gif")
' Shell("C:\Program Files\epstool\bin\epstool.exe --copy -bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
Pause
Everything works except the Shell command. I am just trying to call epstool to readjust the bounding box for the given eps file. It seems to error out, but the window either closes too quickly or doesn't open at all.
Any ideas or ways to get the window to stay open?
Thanks,
Russ
VAR_A=Request("path")
VAR_B=Request("fname")
FileSaveAs(1,"VAR_AVAR_B.grf")
FileSaveAs("Graphics Interchange Format","VAR_AVAR_B.gif")
' Shell("C:\Program Files\epstool\bin\epstool.exe --copy -bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
Pause
Everything works except the Shell command. I am just trying to call epstool to readjust the bounding box for the given eps file. It seems to error out, but the window either closes too quickly or doesn't open at all.
Any ideas or ways to get the window to stay open?
Thanks,
Russ
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
Okay you got me now... David will have to explain if there's a way for you to do variable substitution into a quoted command line.
BTW - I notice that there's another option for getting around the "spaces in path" issue that David implemented. If you use the format
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" <options>",3) it should work also (at least in the most recent releases).
BTW - I notice that there's another option for getting around the "spaces in path" issue that David implemented. If you use the format
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" <options>",3) it should work also (at least in the most recent releases).
- RAS
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
"It seems the expansion of the variables VAR_A and VAR_B don't seem to be happening."
Whoops. That's exactly right. The expansion happens just before a command is sent to DPlot. But Shell is handled entirely within the macro editor, never passed to DPlot, and the expansion never takes place. This is fixed on my system and will be in the next release. Sorry for the trouble.
Whoops. That's exactly right. The expansion happens just before a command is sent to DPlot. But Shell is handled entirely within the macro editor, never passed to DPlot, and the expansion never takes place. This is fixed on my system and will be in the next release. Sorry for the trouble.
Visualize Your Data
support@dplot.com
support@dplot.com
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
PS: EPSTOOL sounds like it might be of interest to many DPlot users, but the links at http://pages.cs.wisc.edu/~ghost/gsview/epstool.htm don't work. Do you know of another source?
Visualize Your Data
support@dplot.com
support@dplot.com
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Huh. That's odd. Didn't work for me just now. But if you got it then it must be a glitch rather than a permanent problem. I'll try again later.
For those who have used this, as I assume the two of you have, does this fix the problem that "printing" to an EPS file has - namely that the entire page including white space is included? If so I think a lot of LaTeX users will be interested in this.
For those who have used this, as I assume the two of you have, does this fix the problem that "printing" to an EPS file has - namely that the entire page including white space is included? If so I think a lot of LaTeX users will be interested in this.
Visualize Your Data
support@dplot.com
support@dplot.com
I can confirm that there's some sort of server issue... The page links to an ftp server; I can login anonymously and go to the file directory, but can't keep a link up to retrieve the file. Guess I was just lucky the first couple times. Maybe it will get better....
Can't comment on the epstool utility yet; it looked interesting to me also and I thought I'd try to help Russ out a bit for leading me to it... The zip file contains source as well as a binary, and a copy of a GPL. This version (3.08) appears to have been built in 2005.
Can't comment on the epstool utility yet; it looked interesting to me also and I thought I'd try to help Russ out a bit for leading me to it... The zip file contains source as well as a binary, and a copy of a GPL. This version (3.08) appears to have been built in 2005.
- RAS
Here's a mirror in Switzerland (?) that worked:
ftp://mirror.switch.ch/pool/1/mirror/gh ... -win32.zip
ftp://mirror.switch.ch/pool/1/mirror/gh ... -win32.zip
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Thanks Richard and Jon. Got it.
Unless I badly misunderstand something, though, this doesn't do what I had hoped for. Perhaps russurquhart1 can chime in here and straighten me out.
The Shell command
C:\Program Files\epstool\bin\epstool.exe --copy -bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps
seems to rely on the existence of a previously saved eps file (the _old suffix), which has not been produced by any of the previous commands in the macro. So I'm not sure what this is all about. If I save an EPS file by printing to a file with an EPS printer driver, then go to the command line and use
epstool.exe --copy -bbox oldfile.eps newfile.eps
I get "oldfile.eps is not EPSF" and no newfile.eps produced. So I'm not sure what the purpose of this stuff is. Any clues would be appreciated. Again, it would be a boon to DPlot users to be able to produce EPS files that don't include the whole printed page of white space, as you get by "printing" to an EPS file.
Unless I badly misunderstand something, though, this doesn't do what I had hoped for. Perhaps russurquhart1 can chime in here and straighten me out.
The Shell command
C:\Program Files\epstool\bin\epstool.exe --copy -bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps
seems to rely on the existence of a previously saved eps file (the _old suffix), which has not been produced by any of the previous commands in the macro. So I'm not sure what this is all about. If I save an EPS file by printing to a file with an EPS printer driver, then go to the command line and use
epstool.exe --copy -bbox oldfile.eps newfile.eps
I get "oldfile.eps is not EPSF" and no newfile.eps produced. So I'm not sure what the purpose of this stuff is. Any clues would be appreciated. Again, it would be a boon to DPlot users to be able to produce EPS files that don't include the whole printed page of white space, as you get by "printing" to an EPS file.
Visualize Your Data
support@dplot.com
support@dplot.com
David - my system wasn't all setup to use this, but when I downloaded a recent copy of gswin32c.exe and put it where the epstool could find it, I got it to run. It gave me several complaints about the eps file I fed it, but in the end it generated a file with what looks like an "appropriate" bounding box (at least it looks right in GSview). I'll send samples to your e-mail. -Richard
- RAS
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Got your files, Richard. Thanks very much. This is exactly what I was hoping it would do. I don't have it working yet - so far all of my attempts at getting packages for Win32 containing gswin32c.exe have resulted in "not a valid Win32 application". What is it with *nix people?
Visualize Your Data
support@dplot.com
support@dplot.com
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Mostly for russurquhart1:
I'm not ready to release the full version, but there's no reason to wait for the fixed macro gizmo. Download http://www.dplot.com/macros/dpmac.exe to <dplot folder>\macros, replacing the existing version.
I'm not ready to release the full version, but there's no reason to wait for the fixed macro gizmo. Download http://www.dplot.com/macros/dpmac.exe to <dplot folder>\macros, replacing the existing version.
Visualize Your Data
support@dplot.com
support@dplot.com
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
Thanks David, i'll give that a try.
What we do, or will do, is that the PS output of a Dplot graph, run that through Ghostscript to generate the EPS file. Now, for us, for some reason, the bounding box generated in that step is incorrect, to i take the new eps file and use epstool, to copy the EPS file on through, but put in a new bounding box. This seems to work.
Thanks
Russ
What we do, or will do, is that the PS output of a Dplot graph, run that through Ghostscript to generate the EPS file. Now, for us, for some reason, the bounding box generated in that step is incorrect, to i take the new eps file and use epstool, to copy the EPS file on through, but put in a new bounding box. This seems to work.
Thanks
Russ
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
Getting further:
I have the following:
Shell(""cmd /k C:\Progra~1\epstool\bin\epstool.exe" --copy --bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
Which i think should work, but i get a file not found error.
When i have:
Shell("cmd /k C:\Progra~1\epstool\bin\epstool.exe --copy --bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
it blows up because the path spec has a C:\Program Files, and the epstool command line thinks i am trying to pass C:\Program.
How should i quote this to get the full expansion, which IS working, to be processed by the command line?
Thanks,
Russ
I have the following:
Shell(""cmd /k C:\Progra~1\epstool\bin\epstool.exe" --copy --bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
Which i think should work, but i get a file not found error.
When i have:
Shell("cmd /k C:\Progra~1\epstool\bin\epstool.exe --copy --bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
it blows up because the path spec has a C:\Program Files, and the epstool command line thinks i am trying to pass C:\Program.
How should i quote this to get the full expansion, which IS working, to be processed by the command line?
Thanks,
Russ
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
I've had very little luck with EPSTOOL yet. Richard provided a link to other files that I need, but I haven't had time to check those yet. But off the top of my head and w/o testing this, this:
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" --copy --bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
should work. Or at least give you a different error message . Sorry I can't give a more definitive reply, yet.
If the path returned by VAR_A=Request("path") or VAR_B=Request("fname") contains spaces, then you might need something like:
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" --copy --bbox "VAR_AVAR_B_old.eps" "VAR_AVAR_B.eps"", 3)
but I can't swear to that. So far all I've gotten is error messages related to missing DLL's and whatnot, not an error related to the filenames.
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" --copy --bbox VAR_AVAR_B_old.eps VAR_AVAR_B.eps", 3)
should work. Or at least give you a different error message . Sorry I can't give a more definitive reply, yet.
If the path returned by VAR_A=Request("path") or VAR_B=Request("fname") contains spaces, then you might need something like:
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" --copy --bbox "VAR_AVAR_B_old.eps" "VAR_AVAR_B.eps"", 3)
but I can't swear to that. So far all I've gotten is error messages related to missing DLL's and whatnot, not an error related to the filenames.
Visualize Your Data
support@dplot.com
support@dplot.com
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
Well here are the two lines i tried:
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" --copy --bbox "VAR_AVAR_B_old.eps" "VAR_AVAR_B.eps"", 3)
Shell("cmd /k "C:\epstool.exe" --copy --bbox "VAR_AVAR_B_old.eps" "VAR_AVAR_B.eps"", 3)
The first line gives an error because it thinks C:\Program is an executable it can't find.
The second line gives an error just saying the file/pathspec/volume label is not right.
I think there still is an issue with what type of quotes need to go around the var expansion.
When i try without any qoutes around the vars, it errors because the path spec has a space.
any help is appreciated!
Thanks,
Russ
Shell("cmd /k "C:\Program Files\epstool\bin\epstool.exe" --copy --bbox "VAR_AVAR_B_old.eps" "VAR_AVAR_B.eps"", 3)
Shell("cmd /k "C:\epstool.exe" --copy --bbox "VAR_AVAR_B_old.eps" "VAR_AVAR_B.eps"", 3)
The first line gives an error because it thinks C:\Program is an executable it can't find.
The second line gives an error just saying the file/pathspec/volume label is not right.
I think there still is an issue with what type of quotes need to go around the var expansion.
When i try without any qoutes around the vars, it errors because the path spec has a space.
any help is appreciated!
Thanks,
Russ
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
This is of course no help for the general public, but if you move the epstool files to a folder whose name does NOT contain spaces, and do the same for the input/output eps files, what happens then? My guess is it will work.
I'll make an effort to spend some time on this in the next few days, once I get all of the epstool-associated files I need.
I'll make an effort to spend some time on this in the next few days, once I get all of the epstool-associated files I need.
Visualize Your Data
support@dplot.com
support@dplot.com
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
Some more info, hopefully this will help.
The Dplot file i am working on, G001_LOS600.grf is located on my desktop, C:\Documents and Settings\x0047930\Desktop\G001_LOS600.grf.
I want to tell epstools, from the dplot macro editor the equivalent of the following, which works from the command line to epstools:
c:\Program Files\epstool\bin>epstool --copy --bbox "C:\Documents and Settings\x0047930\Desktop\G001_LOS600_old.eps" "C:\Documents and Settings\x0047930\Desktop\G001_LOS600.eps"
When VAR_A and VAR_B, which have the path name and filename, respectively, are expanded, regardless of how i quote them, don't seem to retain the quotes needed for filenames that contain a space. I think we need someway to escape a double quotes so that that is put into the string that is sent to the shell.
Or just my opinion.
Hope this helps!
Russ
The Dplot file i am working on, G001_LOS600.grf is located on my desktop, C:\Documents and Settings\x0047930\Desktop\G001_LOS600.grf.
I want to tell epstools, from the dplot macro editor the equivalent of the following, which works from the command line to epstools:
c:\Program Files\epstool\bin>epstool --copy --bbox "C:\Documents and Settings\x0047930\Desktop\G001_LOS600_old.eps" "C:\Documents and Settings\x0047930\Desktop\G001_LOS600.eps"
When VAR_A and VAR_B, which have the path name and filename, respectively, are expanded, regardless of how i quote them, don't seem to retain the quotes needed for filenames that contain a space. I think we need someway to escape a double quotes so that that is put into the string that is sent to the shell.
Or just my opinion.
Hope this helps!
Russ
-
- Posts: 14
- Joined: Wed Nov 18, 2009 2:32 pm
Finally solved my problems by having the dplot macro call the .bat file from a directory that did NOT have any spaces in it. And then calling a Perl script to do the rest of the processing.
As someone asked, we are generating .ps files first. Using GS' ps2epsi.bat file to generate a .eps file, then using epstool to fix the bounding box properly on the .eps file. It all kind of goes like this:
.ps (from Print to file in Dplot)
ps2epsi.bat infile.ps outfile_old.eps
epstool --copy --bbox outfile_old.eps outfile.eps
Hope this helps!
Russ
As someone asked, we are generating .ps files first. Using GS' ps2epsi.bat file to generate a .eps file, then using epstool to fix the bounding box properly on the .eps file. It all kind of goes like this:
.ps (from Print to file in Dplot)
ps2epsi.bat infile.ps outfile_old.eps
epstool --copy --bbox outfile_old.eps outfile.eps
Hope this helps!
Russ
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Thanks very much for posting. I'll definitely look into this. I think this might be of real interest to LaTeX users.
Visualize Your Data
support@dplot.com
support@dplot.com