Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2021/05/16)Fwd 1 day (to 2021/05/18) >>>20210517 
suresh Hi , I am new to Ghost script . Facing an issue while converting the postscript file to pdf at processor .start processing and gives me error "An error occured when call to 'gsapi_init_with_args' is made: -100"02:18.53 
  i am using it from C# code02:19.19 
  your help is appreciated02:19.28 
artifexi- <RayJohnston> Without knowing what args are passed, we can't begin. - 100 (fatal error - asking a question without enough info)03:59.50 
suresh this is my code in C#04:38.17 
   using (GhostscriptPipedOutput gsPipedOutput = new GhostscriptPipedOutput())04:38.19 
              {04:38.20 
                  // pipe handle format: %handle%hexvalue04:38.20 
                  string outputPipeHandle = "%handle%" + int.Parse(gsPipedOutput.ClientHandle).ToString("X2");04:38.21 
                  using (GhostscriptProcessor processor = new GhostscriptProcessor())04:38.21 
                  {04:38.22 
                      List<string> switches = new List<string>();04:38.22 
                      switches.Add("-empty");04:38.23 
                      switches.Add("-dQUIET");04:38.23 
                      switches.Add("-dSAFER");04:38.24 
                      switches.Add("-dBATCH");04:38.24 
                      switches.Add("-dNOPAUSE");04:38.25 
                      switches.Add("-dNOPROMPT");04:38.25 
                      switches.Add("-sDEVICE=pdfwrite");04:38.26 
                      switches.Add("-o" + outputPipeHandle);04:38.26 
                      switches.Add("-q");04:38.27 
                      switches.Add("-f");04:38.27 
                      switches.Add(invoicePSFileName);04:38.28 
  I have installed ghost script .exe , Ghost script.NET.dll using package manger console04:40.13 
  want to know if  am missing something04:40.35 
  Do i have to do something on the server which is new one and it's windows server 201904:44.04 
artifexi- <KenSharp> I'm afraid we can't help you with Ghostscript.NET, that is not supplied by us, its maintained by it's original author.06:51.33 
  <KenSharp> One of the first things I would say is that turning off helpful messages (-dQUIET and -q) is not a good idea when you are having problems. For debugging problem you want Ghostscript to tell you as much as it can. You haven't said what 'OutputPipeHandle is, but if iisn't a filename then that's most likely to be your problem. You can't send the output to a pipe (other than stdout, and you would be advised not to do that either).06:53.49 
  <KenSharp> Actually I see you do say what OutputPipeHandle is, and it doesn't look legal to me. Replace that with a simple filename and try again.06:54.53 
  <KenSharp> Well more research indicates that %handle% ought to work, on Windows, but it doesn't get regularly tested. I would still simplify the command line by removing that and using a filename.07:07.22 
  <KenSharp> I'd also mention that using a pipe is potentially not going to work with the pdfwrite device in the long term, and already won't work if you specif FastWebView. The pdfwrite device may need random access to the output file which is obviously not possible with a pipe.07:08.44 
ray_laptop suresh: just an aside, as in the documenation, "-o" implies -dBATCH -dNOPAUSE (and -dNOPROMPT isn't needed with those since gs won't go to a prompt with -dBATCH).13:50.08 
  but those are perfectly acceptable and won't cause any problem13:50.51 
  the %handle% device may be a bit dated.13:54.28 
  ulong hfile;/* This must be as long as the longest handle. */13:54.30 
  /* This is correct for Win32, maybe wrong for Win64. */13:54.31 
artifexi- <KenSharp> Yeah I did say it doesn't get much testing. Which is why I suggest using a filename and see if that works.13:54.57 
  <RayJohnston> yes, good plan. That'll at least figure out if it's the output device13:55.50 
ray_laptop had to go look for it in the source as well :-)13:56.32 
artifexi- <RayJohnston> gswin64c -sDEVICE=txtwrite -o "%handle%00000000" examples/tiger.eps gives:14:00.24 
  <RayJohnston> GPL Ghostscript GIT PRERELEASE 9.55.0: **** Could not open the file 00000000 .14:00.25 
  <RayJohnston> Error: /invalidfileaccess in --showpage--14:00.26 
  <RayJohnston> with pdfwrite after the "Could not open...." it segfaults14:01.00 
  <KenSharp> But presumably tha's because the handle doesn't exist ? I thought you had to use CreatePipe and give hte handle created from that as an argument ?14:01.25 
  <KenSharp> Which would mean some coding, which I'm disiinclined to do on the off-chance14:01.51 
  <RayJohnston> agreed. I was just curious what we would do with an invalid handle14:03.56 
  <KenSharp> Oh well I guess we try to use it, I don't think we can validate it, so if it's invalid or illegal we'll probably crash.....14:04.28 
  <KenSharp> FWIW CretePipe is part of the Win32 API so I expect it to work unchanged in win6414:05.03 
  <RayJohnston> the /invalidfileaccess in --showpage-- is preferable to the SEGV, IMHO14:05.26 
  <KenSharp> Apparently it returns two handles, one for read and one for write, presumably we want the write handle14:05.36 
  <RayJohnston> yes, but I don't know what suresh's "GhostscriptPipedOutput()" does (if it uses CreatePipe)14:06.40 
  <KenSharp> Not a clue14:06.52 
  <RayJohnston> or something newer than the Win32 API14:07.00 
  <RayJohnston> oh. "64-bit versions of Windows use 32-bit handles for interoperability."14:08.08 
  <KenSharp> Yep, win3214:08.24 
  <KenSharp> Looks like 'GhostscriptPipedOutput' is part of Ghostscript.NET, so we can't help with that14:10.23 
  <RayJohnston> apparently the kernel (executive) max value for a handle is 16,777,216, but each "page" can only have 65536 on Win64 (32768 on 32-bit Windows)14:12.19 
  <RayJohnston> so our ancient code in base/gp_mshdl.c is still OK.14:13.53 
  <KenSharp> well from that point of view, yes, but I've no idea the last time anyone tested it, it coudl well be bit-rotted14:14.19 
  <RayJohnston> Seems that @Robin_Watts touched it back in 2019 with commit e6966d10 as part of his "Add gsapi call to introduce new 'Filing Systems' to gs."14:15.39 
  <KenSharp> I wouldn't bet on him having tested it though14:15.59 
  <RayJohnston> but I doubt he tested it (certainly the cluster doesn't)14:16.07 
  <KenSharp> The fact that it exists in Ghostscript.NET leads me to believe that jhabjan has test it though, and it works for him14:16.53 
  <KenSharp> But I have no clue which version he would have tested14:17.12 
kteynor Question:  If there is no Init directory in the Linux install, what does that mean?  Is the gs_init.ps file located elsewhere?  Having a problem because the same Linux box is converting PS files into PDFs with unexpected page sizes, and thought maybe the problem lies in the defaults set in the gs_init.ps file.21:35.04 
 <<<Back 1 day (to 2021/05/16)Forward 1 day (to 2021/05/18)>>> 
ghostscript.com #mupdf
Search: