Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:37:45+00:00 2026-06-17T15:37:45+00:00

I have the ghostscript dll (gsdll32.dll) which I have wrapped into my c# application.

  • 0

I have the ghostscript dll (gsdll32.dll) which I have wrapped into my c# application. I tried various way to convert postscript to jpeg but it’s not happening. The code is as follows:

            PDFPrinter.WGhostScript gs = new PDFPrinter.WGhostScript();
            gs.AddParam("-sDEVICE=jpeg");
            gs.AddParam("-dJPEGQ=100");
            gs.AddParam("-dNOPAUSE");
            gs.AddParam("-dBATCH");
            gs.AddParam("-dSAFER");
            gs.AddParam("-r300");
            string outfile = txtOutFolderLoc.Text + txtFileName.Text + ".jpg";
            gs.AddParam(@"-sOutputFile=" + outfile);
            gs.AddParam(psFilePath);
            gs.Execute();
            Application.Exit();

What might be the reasons?

  1. I have the postscript location at hand in the string “psFilePath”.
  2. “outfile” represents the location and file name of the output.

[I have used the same stuff and converted the postcript to PDF and PNG as following].

To PDF WORKED

            gs.AddParam("-dBATCH");
            gs.AddParam("-dNOPAUSE");
            gs.AddParam("-sDEVICE=pdfwrite");
            gs.AddParam("-sPAPERSIZE=a4");
            gs.AddParam("-sProcessColorModel=DeviceGray");
            gs.AddParam("-sPDFPassword=password");
            string outfile = txtOutFolderLoc.Text + txtFileName.Text + ".pdf";
            gs.AddParam(@"-sOutputFile=" + outfile);
            gs.AddParam(psFilePath);
            gs.Execute();
            Application.Exit();

TO PNG CODE:

            gs.AddParam("-dSAFER");
            gs.AddParam("-dBATCH");
            gs.AddParam("-dNOPAUSE");
            gs.AddParam("-sDEVICE=png16m");
            gs.AddParam("-dGraphicsAlphaBits=4");
            gs.AddParam(@"-sOutputFile=" + txtOutFolderLoc.Text + txtFileName.Text + "%i.png");
            gs.AddParam(psFilePath);
            gs.Execute();
            Application.Exit();

EDIT I
The postscript is being generated and the application continues till it exits. But no jpeg file is found.

The postscript is generated by a postscript printer provided with the ghostscript. Once this postscript is generated the control is transferred to the application that converts this PS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:37:46+00:00Added an answer on June 17, 2026 at 3:37 pm

    I managed to get the output with the following arguments:

                PDFPrinter.WGhostScript gs = new PDFPrinter.WGhostScript();
                gs.AddParam("-q");
                gs.AddParam("-dNOPAUSE");
                gs.AddParam("-dBATCH");
                gs.AddParam("-sDEVICE=jpeg");
                gs.AddParam(@"-sOutputFile=<full oytput file path>%i.jpg");
                gs.AddParam(<psFilePath>);
    

    I had to add in the “-q” to get it done.

    ‘-q to prevent Ghostscript from writing messages to standard output which become mixed with the intended output stream.‘

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a image of dimension 1400x800, which I need to convert to a
I have the following: ghostscript-fonts-5.50-24 ImageMagick-6.7.2-1 ghostscript-9.02-1 Which I use to create a series
I would like to use ghostscript to convert the pdf source into series of
I am converting eps (Encapsulated PostScript) files to jpeg files with ghostscript. A sample
I use Ghostscript to convert PDF documents to PCL for printing. Recently I have
In my application I have to install Ghostscript in the server to run the
I have tried a number of screencapping services but none so far can cap
I'm trying to convert PDFs to PCL (using ghostscript, but I'd love to hear
I am running a ghostscript command from the shell to convert a postscript file
have written this little class, which generates a UUID every time an object of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.