GithubHelp home page GithubHelp logo

Comments (12)

bkwdesign avatar bkwdesign commented on June 24, 2024 3

@Amonra69 - I finally figured out that I need to roll back to GS 9.26 before the .NET wrapper works correctly

from ghostscript.net.

EricSmekens avatar EricSmekens commented on June 24, 2024

I have the same error, when I call StartProcessing.

from ghostscript.net.

mehdyh avatar mehdyh commented on June 24, 2024

Fixed the issue by changing
_rasterizer.Open(mm, lastInstalledVersion, false);
to
_rasterizer.Open(mm, lastInstalledVersion, true);

from ghostscript.net.

JenkaJmenka avatar JenkaJmenka commented on June 24, 2024

I'm sorry for my question
I have the same error.
Any ideas how it can be solved?

from ghostscript.net.

jhabjan avatar jhabjan commented on June 24, 2024

Error -100 means that you are passing some bad parameters or you can try mehdymohajery solutoin.

from ghostscript.net.

dherbe avatar dherbe commented on June 24, 2024

I also got this error and It really wasn't because of bad arguments.
mehdymohajery suggestion worked perfectly.
thanks

from ghostscript.net.

csharpner avatar csharpner commented on June 24, 2024

@mehdymohajery what is this lastInstalledVersion? Where/how do I get it?

from ghostscript.net.

cpayne22 avatar cpayne22 commented on June 24, 2024

@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.

bkwdesign avatar bkwdesign commented on June 24, 2024

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:
image

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.

Amonra69 avatar Amonra69 commented on June 24, 2024

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 avatar Amonra69 commented on June 24, 2024

@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.

brothers-morrison avatar brothers-morrison commented on June 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.