打印为PDF并合并为o
全部的我需要一些关于工作中创建的PDF plot lisp的帮助,创建该lisp是为了将材料列表表PDF格式并将其放入源文件夹中,以表名作为文件名。我想知道是否有人可以帮助找出如何将页面合并在一起,以创建一个文件,一旦他们转换为PDF所有作为一个步骤。
;;;This is the lisp routine to Plot the material list to individual PDF files with the job name and the page number
;;;as is does in the Plot Material List button.
;;; plotpdf.lsp
(defun c:PlotPDF (/ ob ss bn mn mx)
(vl-load-com)
(setq cnt 0)
(setq dir(getvar "dwgprefix"))
(if (and (progn
(initget "B")
(setq ob (entsel "\nSelect Block/B for blockname: "))
(cond
((eq ob "B")
(setq bn (getstring "\nEtner Block Name: "))
)
((and (eq (type ob) 'LIST)
(vlax-method-applicable-p (vlax-ename->vla-object (car ob)) 'getboundingbox))
(setq bn (cdr (assoc 2 (entget (car ob))))))))
(tblsearch "BLOCK" bn)
bn
(setq ss(ssget "_X" (list '(0 . "INSERT")'(410 . "Model")(cons 2 bn))))
)
(progn
(vla-zoomextents (vlax-get-acad-object))
(repeat (setq i (sslength ss))
(setq ML "Material-List")
(setq cnt (1+ cnt))
(vla-getboundingbox (vlax-ename->vla-object (ssname ss (setq i (1- i)))) 'mn'mx)
(command "plot" "yes" "model" "DWG To PDF.pc3" "ANSI A (8.50 x 11.00 Inches)"
"inches" "LANDSCAPE" "no" "Window"
(trans (vlax-safearray->list mn) 0 1)
(trans (vlax-safearray->list mx) 0 1)
"fit" "center" "yes" "acad.ctb""yes" "As Displayed" (strcat dir "ML-" (itoa cnt) "-"(getvar "dwgname")) "no" "yes" "yes" "yes")
(command ".delay" "750")
)
)
(princ "\nNo Blocks Selected: ")
)(princ)
)
谢谢
布瑞恩 Adobe acrobat这是我们可以访问的,它可以作为一个选项进行组合。制作一个包含all-in的pdf可能需要2分钟或更少的时间。88张=15Mb。
有一些帖子是关于PDF的创作者Bluebeam等似乎有这种能力,我相信其他人会发布 谢谢你的回复,我想最大的问题是。。可以通过lisp完成吗?如果AutoCAD无法将它们组合在一起,那很好,请告诉我。。。 有一些帖子是关于使用Publish和制作1个pdf的,非常确定你必须有正确的pdf创建者,我认为Dwg到pdf是行不通的。 Ghostscript可用于组合PDF。
像这样的事情应该会奏效:
(defun KGA_String_Join (strLst delim)
(if strLst
(apply
'strcat
(cons
(car strLst)
(mapcar '(lambda (a) (strcat delim a)) (cdr strLst))
)
)
""
)
)
; (CombinePdf
; "C:\\Program Files\\gs\\gs8.61\\bin\\gswin32c.exe"
; '("D:\\Tmp\\A.pdf" "D:\\Tmp\\B.pdf")
; "D:\\Tmp\\Total.pdf"
; )
; Note: Existing trgFile will be overwritten.
(defun CombinePdf (gsExe srcFileLst trgFile)
(startapp
(strcat
gsExe " "
"-dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite "
"-sOutputFile=\"" trgFile "\" "
"\"" (KGA_String_Join srcFileLst "\" \"") "\""
)
)
) 好主意Roy_043将有一个发挥srcfilelst可以变得非常简单,因为你绘制每个pdf你添加到列表中。然后按照您的代码运行。
在上述代码中
(setq pdfname (strcat dir "ML-" (itoa cnt) "-"(getvar "dwgname")))
(setq srcfilelst (cons pdfname scrfilelst))
似乎工作很好,可以这样做,说超过4个pdf的将有一个男人和女孩聊天。
页:
[1]