-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gsapi_init_with_args returns -100 #127
Comments
+1 |
Can you describe the exact error a bit more ? |
Hi @jamie-lemon , this is the setup that I am using: It is basically the code from the PR: I have just added a bit to FacturXWriteSample.cs that was added here: public void Start()
{
Invoice i = (new Invoice()).setDueDate(DateTime.Now).setIssueDate(DateTime.Now).setDeliveryDate(DateTime.Now).setSender((new TradeParty("Test company", "teststr", "55232", "teststadt", "DE")).addTaxID("DE4711").addVATID("DE0815").setContact(new Contact("Hans Test", "+49123456789", "[email protected]")).addBankDetails(new BankDetails("DE12500105170648489890", "COBADEFXXX"))).setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")).setReferenceNumber("991-01484-64").setNumber("123").
addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal("1.0"), new BigDecimal("1.0")));
ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
zf2p.setProfile(Profiles.getByName("XRechnung"));
zf2p.generateXML(i);
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
string outfilename = "xrechnung.xml";
File.WriteAllBytes(outfilename, zf2p.getXML());
PDFConverter converter = new PDFConverter(@"e:\in.pdf", @"e:\out.pdf");
converter.EmbedXMLForZF(outfilename, "2.1");
converter.ConvertToPDFA3(@"d:\gs\gs9.56.1\bin\gsdll64.dll");
} Nothing else was changed, all files exist. It basically checks for file availability like if (!File.Exists(file_GSDLL_DLL))
{
throw new Exception("Ghostscript DLL " + file_GSDLL_DLL + " bitte ins Verzeichnis " + Directory.GetCurrentDirectory() + " kopieren");
}
... then compiles the command line parameters List<string> switches = new List<string>();
// works : "C:\Program Files (x86)\gs\gs9.52\bin\gswin32c.exe" -dPDFA=1 -dNOOUTERSAVE -sProcessColorModel=DeviceRGB -sDEVICE=pdfwrite -o RG_10690-pdfa.pdf -dPDFACompatibilityPolicy=1 "C:\Program Files (x86)\gs\gs9.52\lib\PDFA_def.ps" RG_10690.pdf
// "C:\Program Files (x86)\gs\gs9.52\bin\gswin64c.exe" -dPDFA=1 -dNOOUTERSAVE -sProcessColorModel=DeviceRGB -sDEVICE=pdfwrite -o RG_10690-pdfa.pdf -dPDFACompatibilityPolicy=1 "C:\Program Files (x86)\gs\gs9.52\lib\PDFA_def.ps" RG_10690.pdf
switches.Add(""); // ' Der allererste Parameter wird mitunter ignoriert weil EXEs da ihren eigenen Namen bergeben bekommen
switches.Add("-P"); // Zugriff auf Ressourcen unterhalb des aktuellen Verzeichnisses erlauben
switches.Add("-dPDFA=3"
... then it starts processing: using (GhostscriptProcessor gsProcessor = new GhostscriptProcessor(gsL))
{
VerboseMsgBoxOutput stdio = new VerboseMsgBoxOutput();
// gsProcessor.StartProcessing(switches.ToArray(), stdio)
gsProcessor.StartProcessing(switches.ToArray(), null/* TODO Change to default(_) if this is not a reference type */);
// (erfolglose) Versuche, das Hngen zu vermeiden...
gsProcessor.Dispose();
} which is part of existing Ghostscript.net, nothing was changed here afaik, so you find everything here:
at this point:
the error is thrown. Parameters of the call are the ones already listed above:
Any thoughts? |
@green0317 Will take a look into this and get back to you as he speaks .NET. Only one thing I thought you could try is The only other sanity check I have for you right now is to ask: Sorry I'm not much help here! |
Other info regarding your -100 code. |
Nothing related directly to the PR but I also getting this error on a new installation and minimal setup: Running by hand:
But with ghostscript.net:
Code:
I have zero indications what is not good, all files are there, accessible and the installation is good. Maybe a problem with gs10.03.1? |
@CPlusPlus17 Thanks for this - this is very likely the underlying issue. I think this project has not been supported properly for GS 10+. @stephanstapel Perhaps if you are willing you could install 9.56 and give it another spin, https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/tag/gs9560 Again, apologies, I am on a Mac so cannot try this .NET stuff out myself. However if we can identify the underlying issue at the very least I can update the README for this project with "doesn't operate with GS 10+" and then look into trying to get someone with knowledge to fix it up. |
@stephanstapel , can you try this: Just make sure you change this line and point it to your native gs dll path:
|
@jhabjan , thanks a lot! It works now with version 9.x (which didn't work before). It doesn't yet work with version 10 though. |
@jamie-lemon , |
There were 3 problems in FacturX part of the code. icc file was not set as "Embedded resource"file_AdobeRGB1988_ICC was pointing to a wrong filenameGetFileInfo was missing FacturX\ bitCheers, |
Ah sorry, I was testing with multiple files. But I can confirm, that every tested file works directly with gswin64c.exe but not with the .net library. Is there any chance to get more verbose output instead of -100? I'm compiled it with 4.8 and 4.8.1. |
Sorry, I oversaw this answer. Thanks for the information. I'll try with GS 9. Same error:
Command line works without problems. |
Some more news, this time good news: I got it working with with gs9 and gs10, I had a non debuggable environment and that caused some troubles to find the problem. |
Hello,
I am trying the code from this pull request:
#126
which is basically a wrapper around Ghostscript.net, not adding additional behavior to the core of the library.
I am initializing Ghostscript here
Ghostscript.NET/Ghostscript.NET/Processor/GhostscriptProcessor.cs
Line 334 in 1e27dc0
with these parameters:
I have simplified all paths as good as possible, tried it with 32 bit and 64 bit Ghostscript (adopting compilation target as well). I have tried both gs9.56.1 and gs10.03.1. Unfortunately I have no idea what else I could try. As I guess it is hard to guess from a distance what the reason might be, is there any chance to get further insights on what might happen here?
Thanks a lot in advance!
The text was updated successfully, but these errors were encountered: