Jump to content
amb2301

lisp to plot mass drawing layouts to single pdf

Recommended Posts

amb2301

Hi Friends, 

                 I am having a task to open all drawings(nearly 50 drawings) from a single folder path & plot the layouts to pdf (monochrome),

Note: All the plotted pdf to be in a single pdf file.

some one help & please provide me the lisp to do this task.

 

Thanks in Advance.

Share this post


Link to post
Share on other sites
maratovich

Have you tried using Publish?
Add an example of your file.

Share this post


Link to post
Share on other sites
Emmanuel Delay

Yes, if you open these 50 dwg's in 1 Autocad window, then Publish can make 1 pdf of these open dwg's.

 

Is that acceptable?

Edited by Emmanuel Delay

Share this post


Link to post
Share on other sites
gustavobernardi

You can generate a multi-page DWF file with publish, then you can open it in design review and plot to PDF with a installed PDF printer.

Share this post


Link to post
Share on other sites
BIGAL

You can open 50 dwgs plot a pdf then use Ghostscript to join them all back into 1 pdf. You will need to download Ghostscript its free software.

 


;MergePdfs
;Merges multiple pdf (or eps) files into one
;Requires the installation of Ghostscript 

; make a batch file ?
;gs -sDEVICE=pdfwrite \
;    -dNOPAUSE -dBATCH -dSAFER \
;    -sOutputFile=combined.pdf \
;    first.pdf \
;    second.pdf \
;    third.pdf [...]

;Ghostscript (http://www.ghostscript.com/) can be used to combine PDFs.

; Something like this should work: by Roy_043

(defun KGA_String_Join (strLst delim)
(if strLst
(apply
'strcat
(cons
(car strLst)
(mapcar '(lambda (a) (strcat delim a)) (cdr strLst))
)
)
""
)
)

; (CombinePdf 
;  (setq gsexe "C:\\Program Files\\gs\\gs9.19\\bin\\gswin64c.exe")
(setq gsexe "P:\\gs\\gs9.19\\bin\\gswin64c.exe")
; (setq srcFilelst  '("D:\\Tmp\\A.pdf" "D:\\Tmp\\B.pdf"))
; (setq trgfile "C:\\Acadtemp\\Total.pdf")
; )
; Note: Existing trgFile will be overwritten.
(defun CombinePdf (gsExe srcFileLst trgFile)
(startapp 
(strcat
gsExe " "
"-sDEVICE=pdfwrite -dBATCH -dNOPAUSE -dQUIET  "
"-sOutputFile=\"" trgFile "\" "
"\"" (KGA_String_Join srcFileLst "\" \"") "\""
)
)
)


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×