|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
下面代码中,如果使用PLOTTODEVICE方法,是可以打印成功的,但是需要手动输入文件名& ?0 b4 Z" L8 y2 y% V
" y' b/ u, ~& ~4 M2 h. Q. D9 O我想让程序中自动输出文件名,所以使用了plottofile方法,结果却无法正确输出了,输出的PDF文件打不开
" q! t; A; A% y% w' L
( e7 Y, {! m9 G代码如下,请大虾指点,谢谢
/ [9 R9 K0 T) x6 e6 {6 l
# I9 H/ G+ p' V: ^$ z4 [- 5 {5 {0 T5 N/ u( n3 ?" m
- ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo '刷新打印设备信息6 M p! J! o+ t J. Y; c7 K
- ThisDrawing.ModelSpace.Layout.ConfigName = "Adobe PDF" '设置打印机为虚拟打印机 Microsoft Office Document Image Writer
8 s/ d2 ~5 p0 l" e - ThisDrawing.ModelSpace.Layout.CanonicalMediaName = "A3" '设置纸型为A3
t7 v4 j8 L# n) o: ~% t' w - ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result
7 [# l( u" Z) y4 Z& h2 V - ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 4
* O% j- C: \5 O( ]9 a5 ~ - ' RegCloseKey Result8 y" k" t: b0 {; l" q' N7 B4 F2 `
- Dim point1(0 To 1) As Double, point2(0 To 1) As Double
; U) \- ]1 ?7 g$ ^, o - Dim path11 As String1 p7 A9 b5 q! L
- path11 = "D:\123.pdf": K8 a% a- ^5 O8 F6 t
- Scal = 39
8 \& Q+ [* }& K3 B8 T - point1(0) = 0 '安装图1
' m, I5 g5 Q- H - point1(1) = 0
Z3 y8 e6 f% w, w- } - point2(0) = 420 * Scal
5 v6 C* L8 z; R - point2(1) = 297 * Scal
, S. M: q9 V3 |- m+ k- C - ThisDrawing.ActiveLayout.SetWindowToPlot point1(), point2()9 ]1 z& u9 r* M: R+ l
- ThisDrawing.ActiveLayout.GetWindowToPlot point1(), point2()
# W2 `) Y4 H! n - ThisDrawing.ModelSpace.Layout.PlotRotation = ac90degrees
% x& k: h+ F6 w, p" |4 [" s/ B - ThisDrawing.Regen acActiveViewport$ m8 g5 _# M3 y
- ThisDrawing.Plot.NumberOfCopies = 1
; b* g- s4 `# H' F i% v4 Q5 v/ b% K - ThisDrawing.ModelSpace.Layout.PlotType = acWindow
) u2 @# u! i* _* l - ThisDrawing.ModelSpace.Layout.StandardScale = acVpScaleToFit
3 f8 s0 x5 E& k& ?8 h7 h - ThisDrawing.ModelSpace.Layout.CenterPlot = True: D6 K |" U! w' k. u9 S
- ThisDrawing.Plot.QuietErrorMode = True+ v7 T) h: B4 y& K1 j4 g1 Y
- , _* U( _% s$ ~# n- K9 B6 U8 r4 Z
-
" ^- U6 q% T' | D8 ?* A - ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result" @$ o% B Q- T$ l1 W& O
- ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 4
3 K0 T' k" j' `, F - ' RegCloseKey Result; p( ?0 {5 r) w! G( j$ o& I9 T
- ThisDrawing.Plot.PlotToFile path11& A6 Q: O* w+ A! H
- . W& l1 u1 W$ K) R, C7 W
复制代码 |
|