Comments (12)
@Amonra69 - I finally figured out that I need to roll back to GS 9.26 before the .NET wrapper works correctly
from ghostscript.net.
I have the same error, when I call StartProcessing.
from ghostscript.net.
Fixed the issue by changing
_rasterizer.Open(mm, lastInstalledVersion, false);
to
_rasterizer.Open(mm, lastInstalledVersion, true);
from ghostscript.net.
I'm sorry for my question
I have the same error.
Any ideas how it can be solved?
from ghostscript.net.
Error -100 means that you are passing some bad parameters or you can try mehdymohajery solutoin.
from ghostscript.net.
I also got this error and It really wasn't because of bad arguments.
mehdymohajery suggestion worked perfectly.
thanks
from ghostscript.net.
@mehdymohajery what is this lastInstalledVersion? Where/how do I get it?
from ghostscript.net.
@csharpner this worked for me:
GhostscriptVersionInfo gsVersionInfo = GhostscriptVersionInfo.GetLastInstalledVersion(GhostscriptLicense.GPL | GhostscriptLicense.AFPL, GhostscriptLicense.GPL);
Source: https://stackoverflow.com/q/26917330/5188
from ghostscript.net.
I'm still getting this error and none of the solutions posted above worked. I just finished running the .exe to install Ghostscript to my Windows 10 workstation on C:/Ghostscript
I can see my "last version info" is being detected successfully when I debug:
Here's my code snippet that is failing:
int desired_x_dpi = 96;
int desired_y_dpi = 96;
string inputPdfPath = "sample.pdf";
using (var rasterizer = new GhostscriptRasterizer())
{
GhostscriptVersionInfo gsVersionInfo = GhostscriptVersionInfo.GetLastInstalledVersion(GhostscriptLicense.GPL | GhostscriptLicense.AFPL, GhostscriptLicense.GPL);
byte[] buffer = File.ReadAllBytes(inputPdfPath);
MemoryStream ms = new MemoryStream(buffer);
rasterizer.Open(ms, gsVersionInfo, true);
}
from ghostscript.net.
Same issue, Solution of @mehdyh doesn't work. I try to setup dll manually but it doesn't work again
int desired_x_dpi = 96;
int desired_y_dpi = 96;
string inputPdfPath = @"C:\image.pdf";
string outputPath = @"C:\";
var _lastInstalledVersion = new GhostscriptVersionInfo(Version.Parse("9.53.3"), @"C:\Program Files (x86)\gs\gs9.53.3\bin\gsdll32.dll", @"C:\Program Files (x86)\gs\gs9.53.3\lib\gsdll32.lib", GhostscriptLicense.GPL);
using (var _rasterizer = new GhostscriptRasterizer())
{
//MemoryStream usage sample
byte[] buffer = File.ReadAllBytes(inputPdfPath);
MemoryStream ms = new MemoryStream(buffer);
_rasterizer.Open(inputPdfPath, _lastInstalledVersion, true);
for (int pageNumber = 1; pageNumber <= _rasterizer.PageCount; pageNumber++)
{
string pageFilePath = Path.Combine(outputPath, "Page-" + pageNumber.ToString() + ".png");
Image img = _rasterizer.GetPage(desired_x_dpi, desired_y_dpi, pageNumber);
img.Save(pageFilePath, ImageFormat.Png);
Console.WriteLine(pageFilePath);
}
}
from ghostscript.net.
@Amonra69 - I finally figured out that I need to roll back to GS 9.26 before the .NET wrapper works correctly
you save my time
thank you
from ghostscript.net.
note:
this did NOT fix it for me
@Amonra69 - (https://stackoverflow.com/a/56230513/1520850) [you] need to roll back to GS 9.26 before the .NET wrapper works correctly
Trying to use Ghostscript.NET out of the box with the following
switches: -sDEVICE=mswinpr2 -dNoCancel=true -dQueryUser=3 -dPrinted -dBATCH -dNOPAUSE -dNOPROMPT -dNOSAFER -dNumCopies=1 -sOutputFile="%printer%\\network_installed\printer1" "\\network_fileshare\LS-F123.pdf"
from ghostscript.net.
Related Issues (20)
- Is it possible to print user controls with ghostscript?
- Unable to Convert Pdf to Png Using Ghostscript.Net Visual Studio 2022 HOT 2
- Converting PDF pages to images (new PDF interpreter problem) HOT 1
- 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
- Random App Pool crashes HOT 3
- Silently Print HOT 3
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.