|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
下面代码中,如果使用PLOTTODEVICE方法,是可以打印成功的,但是需要手动输入文件名# t2 c8 Q4 j6 W/ \4 ^& P1 f9 U
F# H. L5 H: r" u0 D. L
我想让程序中自动输出文件名,所以使用了plottofile方法,结果却无法正确输出了,输出的PDF文件打不开6 z) ?& x0 l7 K: U6 ^1 r. I _: @
* b3 G3 K; Y+ Q
代码如下,请大虾指点,谢谢
) J( l {! A1 _5 t: ]
, Q1 {( u& k3 y6 {$ G/ i-
8 s2 |, O1 P" [% h - ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo '刷新打印设备信息3 k2 _0 g6 Z5 p& K5 w1 j5 }
- ThisDrawing.ModelSpace.Layout.ConfigName = "Adobe PDF" '设置打印机为虚拟打印机 Microsoft Office Document Image Writer& j/ f' v) ^1 \8 O* N$ m w
- ThisDrawing.ModelSpace.Layout.CanonicalMediaName = "A3" '设置纸型为A3
4 `: H2 q; d* N. T - ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result# [) g7 [& k Y! t. H, B- z
- ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 4
2 A/ D2 S, c- `$ T+ b - ' RegCloseKey Result
) z0 d5 n, o- o4 T, F - Dim point1(0 To 1) As Double, point2(0 To 1) As Double2 \% x% ~# h7 f* b
- Dim path11 As String* R6 Q9 U( e, z) Z% @: J
- path11 = "D:\123.pdf"7 U' V. w' c" ~; S" W1 J2 S
- Scal = 39
1 f+ ^( n1 Y4 [& s+ F - point1(0) = 0 '安装图1$ U: o7 M8 `7 h
- point1(1) = 0
2 g- o0 J9 N, n' K% Y1 ~; R9 D - point2(0) = 420 * Scal
" w7 s% m4 M2 ?6 R' D - point2(1) = 297 * Scal
, F# |( X& _( c" L3 y% v - ThisDrawing.ActiveLayout.SetWindowToPlot point1(), point2()) {8 Z! |9 g: F1 m
- ThisDrawing.ActiveLayout.GetWindowToPlot point1(), point2()6 x" N/ }9 I& K3 b
- ThisDrawing.ModelSpace.Layout.PlotRotation = ac90degrees4 c7 x; t9 K% A+ V7 ^8 a
- ThisDrawing.Regen acActiveViewport
7 P: O: b0 V# v1 g0 P - ThisDrawing.Plot.NumberOfCopies = 1! G3 G7 s ?% b7 ?
- ThisDrawing.ModelSpace.Layout.PlotType = acWindow
* E& K I! g+ P% x Q - ThisDrawing.ModelSpace.Layout.StandardScale = acVpScaleToFit5 J: ^( K* h# x; j5 C, v' m
- ThisDrawing.ModelSpace.Layout.CenterPlot = True0 `( P9 u& }' R1 e$ h
- ThisDrawing.Plot.QuietErrorMode = True
* e9 `6 G* f2 E4 k8 ?3 q9 G& t1 j - * q* Q) W: v* r! ~) c( S3 I
-
& `6 {0 V0 ]$ F) B" d9 v' N" x! b - ' RegOpenKeyEx HKEY_CURRENT_USER, regpath, 0, KEY_ALL_ACCESS, Result
g" w; V- g! n$ X- A - ' RegSetValueEx Result, "OpenInMODI", 0, reg_dword, 0, 48 Y; x1 h; l3 _: |
- ' RegCloseKey Result2 d5 _8 l+ |+ a" p' Y! u
- ThisDrawing.Plot.PlotToFile path11
1 x9 a+ L5 Z: H0 X# B - / t1 _+ h+ x8 m, R+ O
复制代码 |
|