几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-12, 06:39 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how to silent printing pdf from sw macro

how to silent printing pdf from sw macro?
i have a macro that saves sw drawing as pdf file in specific location based on file name, than it opens the pdf in acrobat so i can print it (we do hard copies of pdf not slddrw)
to me this last step (opening pdf) is unnecessary so my question is:
how do i print pdf form sw macro silently without use intervention?
ps,
i'm not that good in vb so be detailed please
can you upload the macro or codes you using. i will try to modify them to suit your requirements.
deepak gupta
sw2007 sp5.0
sw2009 sp2.1
from a command line use - acrord32.exe /t fullpdfpath - this should open the pdf, print it, close it. it may not be what you wanted, but it is a quick solution.
solidworks 2009 sp2.0
dbworks r10 sp2.1
dell precision 390
windows xp pro sp2 - 32 bit
2.40 core 2 duo
4 gb memory
nvidia quadro fx 3450/4000
great someone actually reads this!!
i cant get the attachment to work on this form...
but you can get the file here:
add this line to your macro to print the pdf
shell ("c:\program files\adobe\reader 8.0\reader\acrord32.exe /t path printername drivername portname")
from
acrord32.exe /t path printername drivername portname
initiates acrobat reader, prints a file while suppressing the acrobat print dialog box, then terminates reader.
the four parameters of the /t option evaluate to path,printername, drivername, and portname (all strings).
printername - the name of your printer.
drivername - your printer driver's name. whatever appears in the driver used box when you view your printer's properties.
portname - the printer's port. portname cannot contain any "/" characters; if it does, output is routed to the default port for that printer.
mine looks like this except for the bogus ip address
acrord32.exe /t pdfexportname kyocera mita km-4035 kyocera mita km-4035 ip_123.456.789.012
solidworks 2009 sp2.0
dbworks r10 sp2.1
dell precision 390
windows xp pro sp2 - 32 bit
2.40 core 2 duo
4 gb memory
nvidia quadro fx 3450/4000
edited: 03/02/2009 at 04:47 pm by david hales
great
this is exactly what i'm looking for, and i can get this to work from command prompt under one condition
if i change the directory to acrobat folder and then run this code:
acrobat.exe/t "y:\vault\parts\11-0276.pdf" "\\davinci\vellum" "canon pixma ip3000" "printserver-canon"
and this is perfect solution; even printer doesn't have to be installed on work station just on the server
the problem i'm getting in to is kind of silly but i can't find way around it
i need this to execute from whichever director i'm in, so i'm thinking this should be the proper command:
"c:\program files\adobe\acrobat 9.0\acrobat\acrobat.exe/t" "y:\vault\parts\11-0276.pdf" "\\davinci\vellum" "canon pixma ip3000" "printserver-canon"
i'm using quotation marks because of the spaces in directory names but somehow when i use the "/t" causes the acrobat to comeback with error msg "file not found" but it opens the pdf
therefore my question is:
where do i put these quotation marks for this to work?
thanks for help
"c:\program files\adobe\acrobat 9.0\acrobat\acrobat.exe " "/t" "y:\vault\parts\11-0276.pdf" "\\davinci\vellum" "canon pixma ip3000" "printserver-canon"
nope
doesn't work
these are the errors acrobat returns
"there was an error opening this document. this file cannot be found"
-then it opens the pdf file
"there was an error opening this document. the parameter is incorrect"
"there was an error opening this document. this file cannot be found"
i have tried to put spaces and quotes in many different places with no luck
it appears that when /t is in any quotes it will comeback with an error
i guess i will have to use the old style 8.3 dos naming format
any suggestions what is the easiest way of converting this to it
bingo!!
c:\program files\adobe\acrobat 9.0\acrobat>"c:\program files\adobe\acrobat 9.0\acrobat\acrobat.exe " /t "y:\vault\parts\11-0276.pdf" "\\davinci\vellum" "canon pixma ip3000" "printserver-canon"
no quotes around /t
thanks guys ...
one more thing..
should acrobat close its self when done or just stay minimized
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
Scheme 程序语言介绍之一 huangyhg 专家系统 6 2010-02-18 01:22 PM
How to start SW 2007 or SW 20006 via SW API? If I have two different versions of SW yogy SolidWorks二次开发 1 2007-05-21 09:19 AM
下载好多软件 ping CAD资料交换区 6 2007-03-03 09:13 PM


所有的时间均为北京时间。 现在的时间是 11:05 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多