API: SaveAs4, how to save every sheet on separate PDF file?

Discussion in 'SolidWorks' started by Markku Lehtola, Jan 4, 2007.

  1. Hi,

    SaveAs4 (like SW as well) saves all drawing sheets into one file, but
    is there a way to have separate pdf files for every sheet?

    regards
    Markku
     
    Markku Lehtola, Jan 4, 2007
    #1
  2. Markku Lehtola

    fcsuper Guest

    I'm not sure you can do it with the SaveAs4. You may need to use
    PrintOut2 instead.

    Matt
     
    fcsuper, Jan 4, 2007
    #2
  3. PrintOut seems to give me just .prn files, and I need pdf's
     
    Markku Lehtola, Jan 4, 2007
    #3
  4. Markku Lehtola

    fcsuper Guest

    Markku,

    Sorry, I am used to having Adobe Acrobat Professional installed on my
    computer. With it, PDF Printer is an option as a printer. If you have
    Acrobat Professional installed, PrintOut2 would allow you to do what
    you ask. With that said, I highly recommend getting Acrobat
    Professional. :)

    I'm sorry I do not know a solution using SaveAs4.


    Matt
     
    fcsuper, Jan 4, 2007
    #4
  5. You can use free tools like FreeDist to turn .prn to pdf, but in this
    case it's not a solution.
     
    Markku Lehtola, Jan 4, 2007
    #5
  6. Ok, getting somewhere with this one:

    install GhostScript
    create .prn with ps printer driver
    translate prn to pdf like this:

    Sub main()

    Dim gspath As String
    Dim inputfile As String
    Dim outputfile As String
    Dim retval As Boolean
    Dim wholecommand As String

    gspath = "C:\Program Files\gs\gs8.51\bin\gswin32c.exe"
    inputfile = "c:\temp\_pdfkoe\test 2.prn"
    outputfile = "c:\temp\_pdfkoe\test 2.pdf"

    wholecommand = gspath & Chr(32) & "-sDEVICE#pdfwrite -dNOPAUSE -dQUIET
    -dBATCH -sOutputFile#" & Chr(34) & outputfile & Chr(34) & Chr(32) &
    Chr(34) & inputfile & Chr(34)

    retval = Shell(wholecommand)

    End Sub
     
    Markku Lehtola, Jan 5, 2007
    #6
  7. Markku Lehtola

    Tony Guest

    Mark, there's also an inexpensive program you can buy called Win2Pdf. It's
    a print driver that uses the windows print dialog to print desired pages.

    Tony
     
    Tony, Jan 6, 2007
    #7
  8. Printing should be done background without any dialogs etc. Got also
    this information:

    If you are using 2007 sp1, "modeldoc2.saveas4" has been replaced with
    "modeldocext.saveas". This has options for exporting pdf files sheet by
    sheet.
     
    Markku Lehtola, Jan 6, 2007
    #8
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.