Java库以编程方式将AutoCAD .dwg文件转换为PDF或图像?

use*_*544 3 autocad dwg

是否有一个Java库(免费和开源)将.dwg文件直接转换为PDF或图像文件?.dwg使用CAD的最新规范(R14,R13,R12和2013).

我知道.NET和C++中有一些...... Java中的一些主要是专有且昂贵的(例如:Teigha for Java).

Java中的免费软件如Kabeja通过中间格式.dxf,这是一个非常庞大的文件......

Aug*_*ves 5

不确定库,但您当然可以使用AutoCAD I/O,它是作为Web服务运行的AutoCAD,无需在您的计算机上运行任何应用程序.有关详细信息,请访问http://developer.autodesk.com

这是一个脚本(.scr),您可以在AutoCAD Console上使用该脚本来创建PDF文件.在这里工作得很好.

(setq CurrDwgName (getvar "dwgname"))
(setq Fname (substr CurrDwgName 1 (- (strlen CurrDwgName) 4)))
(setq name (strcat (getvar "DWGPREFIX") Fname ".pdf"))
;Command:
FILEDIA
;Enter new value for FILEDIA <1>:
0
;Command:
-PLOT
;Detailed plot configuration? [Yes/No] <No>: 
Yes
;Enter a layout name or [?] <Model>:
Model
;Enter an output device name or [?] <None>:
DWG To PDF.pc3
;Enter paper size or [?] <ANSI A (11.00 x 8.50 Inches)>:
ANSI A (11.00 x 8.50 Inches)
;Enter paper units [Inches/Millimeters] <Inches>:
Inches
;Enter drawing orientation [Portrait/Landscape] <Portrait>: 
Landscape
;Plot upside down? [Yes/No] <No>:
No
;Enter plot area [Display/Extents/Limits/View/Window] <Display>: 
Extents
;Enter plot scale (Plotted Inches=Drawing Units) or [Fit] <Fit>:
Fit
;Enter plot offset (x,y) or [Center] <0.00,0.00>:

;Plot with plot styles? [Yes/No] <Yes>:
Yes
;Enter plot style table name or [?] (enter . for none) <>:
.
;Plot with lineweights? [Yes/No] <Yes>:
Yes
;Enter shade plot setting [As displayed/legacy Wireframe/legacy Hidden/Visualstyles/Rendered] <As displayed>:

;Enter file name <C:\Work\solids-Model.pdf>:
!name
;Save changes to page setup? Or set shade plot quality? [Yes/No/Quality] <N>:
No
;Proceed with plot [Yes/No] <Y>:
Yes
;Command:
FILEDIA
;;;Enter new value for FILEDIA <1>:
1 
Run Code Online (Sandbox Code Playgroud)

如果您感觉像'老派',请创建一个.BAT文件:

FOR %%f IN (C:\dwg_folder\*.dwg) DO "C:\Program Files\Autodesk\AutoCAD 2016\accoreconsole.exe" /i "%%f"  /product ACAD /s "C:\folder\PDFScript.scr" /l en-US
Run Code Online (Sandbox Code Playgroud)

这应该将特定文件夹中的所有DWG批处理为PDF