Problem With GhostScript /PDF creator Lisp Routine:

Discussion in 'AutoCAD' started by steedj, May 18, 2004.

  1. steedj

    steedj Guest

    Hello,
    I'm running Acad2004; Window 2K;

    I have a Lisp Routine that creates Postscript(s), and then uses Ghostscript to convert the Postscript(s) to a PDF file. When the Ghostscript files are on my PC the routine works fine but when I load the Ghostscript files onto my Network server so that others can use my Program, the routine will not create a PDF. The routine appears to access Ghostscript on the server but there is no resulting PDF. Does anyone know why this will not create a PDF? If I have to, I'll load Ghostscript on each person’s computer but I was trying to avoid that scenario.

    Here's the relevant portion of my Code:

    (defun make_PDF ()

    (setq dwg_name (getvar "dwgname")
    pltname (substr dwg_name 1 (- (strlen dwg_name) 4))
    DwgPfx (getvar "dwgprefix")
    PDFFILE (strcat DwgPfx pltname ".pdf")
    );setq

    ;; Setup sorted list of Postscript files to send to Ghostscript exe file
    (setq GS_sheet1 (strcat DwgPfx pltname "s" "1" ".plt"));;first sheet
    (setq PlotFILE_multi GS_sheet1)

    ;;SERVER LOCATION:
    (setq GSEXE "Z:\\Acad2004\\PDF\\gs\\gs7.04\\bin\\gswin32c.exe")

    ;;------------------------------------
    ;;Multi sheet Set Ghostscript switches:
    ;;------------------------------------
    ;
    (setq GSARGS (strcat
    " -sDEVICE=pdfwrite"
    " -q"
    " -dPDFSETTINGS=/prepress"
    " -dCompatibilityLevel=1.3"
    " -dNOPAUSE"
    " -dBATCH"
    " -sOutputFile=" PDFFILE
    " -c .setpdfwrite"
    " -f " PlotFILE_multi
    ));setq

    ;;----------------------
    ;;Run Ghostscript:
    ;;----------------------
    (startapp GSEXE GSARGS)

    (princ)
    );end Make_pdf
     
    steedj, May 18, 2004
    #1
  2. steedj

    zeha Guest

    i am not sure
    maybe it's the apostrofe

    (setq GSEXE "\"Z:\\Acad2004\\PDF\\gs\\gs7.04\\bin\\gswin32c.exe"\")
     
    zeha, May 19, 2004
    #2
  3. steedj

    steedj Guest

    Thanks for the reply but that's not it.

    I think this may be my problem:
    Ghostscript has Library files, Font files, and a driver file (gsdll32.dll) that must be accessed in order for the conversion of the Postscript to PDF to be successful.
    Since I installed Ghostscript on the server, the path to those files are in my registry; However, when other folks try and use my routine, via the server, they do not have access to those File paths. I am now trying to figure out how to get my Routine to include those file paths. Anyone have any idea as to how to do that? I'm guessing that the paths have to be included as Ghostscript switches.

    The paths are as follows on my server:
    Z:\Acad2004\PDF\gs\gs7.04\lib
    Z:\Acad2004\PDF\gs\fonts
    Z:\Acad2004\PDF\gs\gs7.04\bin\gsdll32.dll

    Thanks,
    J.Steed
     
    steedj, May 19, 2004
    #3
Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.