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

Jan 04, 2007 7 Replies

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



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

Matt

Markku Lehtola wrote:

PrintOut seems to give me just .prn files, and I need pdf's

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

Markku Lehtola wrote:

You can use free tools like FreeDist to turn .prn to pdf, but in this case it's not a solution.

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

--------------

It's amazing how difficult PDF stuff is sometimes for SW and how easy it's to use free tools like GhostScript...

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

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.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required