ghostscript

Discussion in 'Python' started by Chris Jankowski, Sep 7, 2004.

  1. Hi all,
    I am still fairly new to the Python community and world of Python
    programming.

    I am having some trouble changing the output directory when I call
    Ghostscript.
    Any sugguestions would be greatly appreciated. It seems to work fine,
    if I put the file in a directory that I am calling it from, like
    outputdir = './temp' or I use the "C" drive w/ outputdir = ''. All I
    am doing is converting a .pdf to a .tif.

    device = 'jpeg'
    print pdffile
    pdffile = 'c:/Chris_J_Stuff/chris.pdf'
    outputdir = "c:\\Chris_J_Stuff\\"
    print pdffile
    print outputdir
    suffix = 'tif'
    os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
    -sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,
    pdffile))


    Thank you in advance.

    Chris J.
     
    Chris Jankowski, Sep 7, 2004
    #1
    1. Advertising

  2. (Chris Jankowski) writes:

    > os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
    > -sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,
    > pdffile))


    What about
    os.system('copy '+)
    ?

    --
    Brian (remove the sport for mail)
    http://www.et.dtu.dk/staff/be
     
    Brian Elmegaard, Sep 9, 2004
    #2
    1. Advertising

  3. On 7 Sep 2004 11:07:44 -0700, (Chris Jankowski) wrote:

    >Hi all,
    >I am still fairly new to the Python community and world of Python
    >programming.
    >
    > I am having some trouble changing the output directory when I call
    >Ghostscript.
    >Any sugguestions would be greatly appreciated. It seems to work fine,
    >if I put the file in a directory that I am calling it from, like
    >outputdir = './temp' or I use the "C" drive w/ outputdir = ''. All I
    >am doing is converting a .pdf to a .tif.
    >
    >device = 'jpeg'
    >print pdffile
    >pdffile = 'c:/Chris_J_Stuff/chris.pdf'
    >outputdir = "c:\\Chris_J_Stuff\\"
    >print pdffile
    >print outputdir
    >suffix = 'tif'
    >os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
    >-sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,

    ^^^^--??
    >pdffile))
    >
    >
    >Thank you in advance.
    >

    Suggest replacing 'os.system' with 'print repr' until it looks right.

    Regards,
    Bengt Richter
     
    Bengt Richter, Sep 9, 2004
    #3
  4. (Chris Jankowski) wrote in message news:<>...
    > Hi all,
    > I am still fairly new to the Python community and world of Python
    > programming.
    >
    > I am having some trouble changing the output directory when I call
    > Ghostscript.
    > Any sugguestions would be greatly appreciated. It seems to work fine,
    > if I put the file in a directory that I am calling it from, like
    > outputdir = './temp' or I use the "C" drive w/ outputdir = ''. All I
    > am doing is converting a .pdf to a .tif.
    >
    > device = 'jpeg'
    > print pdffile
    > pdffile = 'c:/Chris_J_Stuff/chris.pdf'
    > outputdir = "c:\\Chris_J_Stuff\\"
    > print pdffile
    > print outputdir
    > suffix = 'tif'
    > os.system(ghost_dir + ' -dNOPAUSE -dQUIET -sBATCH -sDEVICE=%s
    > -sOUTPUTFILE=% s/page%%d.%s %s' % (device, outputdir,suffix,
    > pdffile))
    >
    >
    > Thank you in advance.
    >
    > Chris J.


    There is a limit on the length of the command line to pass to
    Ghostscript. I have not figured out how to get around this yet.

    CJ
     
    Chris Jankowski, Sep 15, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher Campbell

    Ghostscript locking files in ASP.NET

    Christopher Campbell, Oct 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,136
    Jacob Yang [MSFT]
    Oct 16, 2003
  2. SpamProof

    ghostscript leaves windword processes

    SpamProof, Feb 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    390
    SpamProof
    Feb 25, 2004
  3. Sjaakie

    ASP.NET and GhostScript

    Sjaakie, May 10, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,630
    Sjaakie
    May 10, 2006
  4. Adam Twardoch
    Replies:
    1
    Views:
    379
    Peter Hansen
    Jul 6, 2005
  5. defcon8

    Ghostscript interface

    defcon8, Sep 10, 2006, in forum: Python
    Replies:
    2
    Views:
    361
    Andrew MacIntyre
    Sep 10, 2006
Loading...

Share This Page