Comments (6)
Similar exception I got when I use a different constructor with loaded ghostscript lib into buffer:
if (Environment.Is64BitProcess)
{
pathToGs = System.IO.Path.Combine(binPath, "gsdll64.dll");
}
else
{
pathToGs = System.IO.Path.Combine(binPath, "gsdll32.dll");
}
List<string> switches = new List<string>
{
"-empty",
"-dSAFER",
"-dBATCH",
"-dNOPAUSE",
"-dNOPROMPT",
"-sDEVICE=pdfwrite",
@"-sOutputFile=" + outputFilePath,
@"-f",
inputFilePath
};
using (GhostscriptProcessor ghostscript = new GhostscriptProcessor(File.ReadAllBytes(pathToGs)))
{
ghostscript.Process(switches.ToArray());
}
from ghostscript.net.
I think the gsdll cannot be found, thats the main error message.
If you replace the path to the actual folder location of the gsdll, does it cause the same error message? Running IIS in production can be very fiddly. I would recommend placing the actual hard coded path to the gsdll. You might be surprised IIS is looking into the c:\windows folder instead of where your Web app is running from.
from ghostscript.net.
Yes, I copy dll's (both x64 and x32) to the bin application folder. Of course the same with GhostsctiptNet.dll
And of course I've installed native GhostsScript library in a server (both x64 and x32). The same effect.
I've tried to initialize GhostScriptProcessor in a different way, as I mentioned above, but its the same message.
But one thing: I use native gswin64.exe locally - no errors.
On a server it throws an exception message: dll cannot be loaded...
So maybe that is the reason, but why?
EDITED:
Can't load Ghostscript DLL
Can't load DLL, LoadLibrary error code 126
Seems, its a missing dependency error.
from ghostscript.net.
Try and retrace your steps. Reinstall ghostscript.net via nuget. You don't need to manually copy it to your webapp bin folder when you build it should do that automatically. You don't need gswin64.exe only the gsdll64.dll/gsdll32.dll and gsdll64.lib/gsdll32.lib.
Another question, is a 64/32 bit version installed? Check in IIS in application pools > Advanved settings. Under general section check if the enable 32-bit applications is enabled and disable it for your webapp. Remember to restart your webapp and app pool.
from ghostscript.net.
Resolved.
I installed GhostScript version 9.18 (64 bit). And no errors with running it locally, on a remote server and using GhostScript.NET.
I use a default constructor in code with default behavior.
List<string> switches = new List<string>
{
"-empty",
"-dSAFER",
"-dBATCH",
"-dNOPAUSE",
"-dNOPROMPT",
"-sDEVICE=pdfwrite",
@"-sOutputFile=" + outputFilePath,
@"-f",
inputFilePath
};
using (GhostscriptProcessor ghostscript = new GhostscriptProcessor())
{
ghostscript.Process(switches.ToArray());
}
from ghostscript.net.
Issue closed.
from ghostscript.net.
Related Issues (20)
- Missing elements/colors when converting PDF to image
- GhostscriptRasterizer.GetPage returns null when using gs.9.56.1 (current version as of Aug 15, 2022) HOT 3
- it
- GhostscriptPngDevice e CustomDllPath
- Error: "'gsapi_init_with_args' is made -100" with long filename and Asian language HOT 1
- GhostscriptRasterizer.GetPage Setting DPI has no impact on the resulting raster
- Attached pdf file raises a System.AccessViolationException HOT 1
- Is it possible to use Stream in Ghostscript.Net and how to reduce pdf size?
- Module could not be loaded HOT 1
- Everything bold and blurred HOT 5
- Ghostscript command to FLATTEN ANNOTATIONS but keep HYPERLINKS alive HOT 9
- Ghostscript - completely REMOVE METADATA from pdf files HOT 5
- -dPreserveAnnotTypes NOT Working HOT 3
- Ghostscript - completely REMOVE METADATA from pdf files 2 HOT 2
- Ghostscript Nuget Package HOT 1
- Postscript file missing part of image when viewing using GhostscriptViewer
- Support Factur-X HOT 1
- Error When Decrypting PDF File
- gs pdfwrite bug of ontours of graphics
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghostscript.net.