![]() |
【转帖】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 |
所有的时间均为北京时间。 现在的时间是 05:36 AM. |