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 7988155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:21:17+00:00 2026-06-04T12:21:17+00:00

I have ghostscript and imagemagick installed in my C drive and i have my

  • 0

I have ghostscript and imagemagick installed in my C drive and i have my wamp server in D drive in which one file has code

<?php exec('convert "sd.pdf[0]" -colorspace RGB -geometry 200 "document.png"'); 
?>

The file sd.pdf exists in the folder in which my program is.This program is giving no error but also its not making a image in that folder.Why?
Additional Question:-Is using Imagemagick and ghostscript in php makes the program slower or faster?

  • 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-04T12:21:19+00:00Added an answer on June 4, 2026 at 12:21 pm

    You need to remove or escape double quotes, it is not working correctly on Windows.
    Take a look at my execute() method for more: https://github.com/webarto/instagraph/blob/master/instagraph.php#L55

    public function execute($command)
    {
        # remove newlines and convert single quotes to double to prevent errors
        $command = str_replace(array("\n", "'"), array('', '"'), $command);
        # replace multiple spaces with one
        $command = preg_replace('#(\s){2,}#is', ' ', $command);
        # escape shell metacharacters
        $command = escapeshellcmd($command);
        # execute convert program
        exec($command);
    }
    

    Chat with one of IM biggest contributors…

    Without any quotes, rgb(255, 255, 255) WITH SPACES will cause
    problems. Similarly the # in the hex values may cause problems if not
    quoted. Double quotes are required if on windows or if using a
    variable. Otherwise, single or double quotes are fine for IM. But if
    you are calling the IM command from PHP exec, then as you know, you
    need to be careful (or escape them).

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

Sidebar

Related Questions

I have ImageMagick, IIS 6, Ghostscript, and PHP 5.3.1 installed on a Windows Server
have a php code like this,going to convert it in to C#. function isValid($n){
I am having some trouble with ImageMagick. I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16
I am trying to get PHP to convert PDFs to JPGs. I have installed
I have a file abc.ps on my desktop. I have installed Ghostscript 9.05 on
Have deployed numerous report parts which reference the same view however one of them
I'm trying to use ghostscript to convert a .ps file to a series of
I am running a ghostscript command from the shell to convert a postscript file
I have written the following code for showing the version number of ghostscript: <html>
I have been successful with extracting text from a PDF file using GhostScript along

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.