|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
下面代码中,如果使用PLOTTODEVICE方法,是可以打印成功的,但是需要手动输入文件名" d5 M1 {% ^0 R6 G& K/ s
& g5 c) W! V* }; X我想让程序中自动输出文件名,所以使用了plottofile方法,结果却无法正确输出了,输出的PDF文件打不开
: Q- V5 G0 y% u! N* H3 a
( ^1 U: j: v: k/ {2 ]4 W9 S代码如下,请大虾指点,谢谢1 N; _: z6 m6 i
) J) J1 Q6 C* p* k6 v+ Q
- . X9 C3 A" q* T$ _ c
- ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo '刷新打印设备信息
/ {3 R6 S" q! ?# H m' K" A! c+ [9 t - ThisDrawing.ModelSpace.Layout.ConfigName = "Adobe PDF" '设置打印机为虚拟打印机 Microsoft Office Document Image Writer
" P) e$ z9 e; y6 P - ThisDrawing.ModelSpace.Layout.CanonicalMediaName = "A3" '设置纸型为A3" b6 K* W8 Z% k" d$ A
- ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result
# W$ `9 C! h3 w4 }: M - ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 4
( s p- t: f' R3 ~6 f# m - ' RegCloseKey Result
8 Z, B _5 x6 P! t& F( i% F! ^ - Dim point1(0 To 1) As Double, point2(0 To 1) As Double
. X. C8 l- W; H - Dim path11 As String
$ ~4 M1 G8 P% r8 z - path11 = "D:\123.pdf"
. r/ I& `% i2 o* F; A. T6 P - Scal = 39
7 Q3 S# q& G( m/ Y# X - point1(0) = 0 '安装图17 T( x0 r4 \* M& |
- point1(1) = 0# b/ K5 W9 S8 S9 Q+ `
- point2(0) = 420 * Scal, K) Z( W- M( V0 [$ A( d
- point2(1) = 297 * Scal$ b7 v4 }2 V% {8 m( J; Z8 D: v+ ^
- ThisDrawing.ActiveLayout.SetWindowToPlot point1(), point2()+ Z# E7 F: `) a6 c# q, w
- ThisDrawing.ActiveLayout.GetWindowToPlot point1(), point2()
( c" X, s6 Y! s* F/ @8 C. q; ` - ThisDrawing.ModelSpace.Layout.PlotRotation = ac90degrees0 _3 Q- x$ U* s0 y) Q, h v$ e
- ThisDrawing.Regen acActiveViewport
5 T& e0 m) B1 t9 r# k; r' o! o - ThisDrawing.Plot.NumberOfCopies = 17 }1 D8 }, e/ L6 p1 z0 j
- ThisDrawing.ModelSpace.Layout.PlotType = acWindow
0 q4 n) q w2 M6 u1 Q - ThisDrawing.ModelSpace.Layout.StandardScale = acVpScaleToFit, h7 g: }1 V# }
- ThisDrawing.ModelSpace.Layout.CenterPlot = True
4 A5 g1 t* j5 |' Y9 ^* F& S - ThisDrawing.Plot.QuietErrorMode = True
% F8 C3 K$ g* { -
0 @5 I7 K8 M+ p$ B% G - : ]% u& ~/ i8 M0 F: L, A0 ^
- ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result) i* v) O2 @! f) y7 ^
- ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 4
' H0 f( u- v4 G - ' RegCloseKey Result
8 s+ p% }5 y" X7 t2 U1 y - ThisDrawing.Plot.PlotToFile path11
+ K/ d1 R1 Q8 `! q: V -
" y% W" J2 W& i: D
复制代码 |
|