TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: HelpLispinSeattle on April 27, 2010, 11:38:36 AM
-
Hello,
I would like to make/create a pdf of a dwg then send/print the pdf silently to a plotter.
Can it be done with autolisp/visual lisp?
I've been researching command lines for acrobat but as I understand it they don't
support command lines for acrobat 8 & higher.
I dont need help with making/creating the pdf with lisp. Its what to do after it.
Any ideas?
-
OOPS,
I misread this one
What I do is:
- plot to a postscript file in acad via autolisp
- write a ps based on runfilex.ps
- then open that file with Distiller
- then send this to a plotter via a dos type binary copy
But it is not single step silent scenario. I can do that with HPGL2 files, not PDFs
That allows me to sort the pages as required, and make a single multipage PDF. -Daivd
-
you can try something other than acrobat
as for me, i use http://www.foxitsoftware.com/pdf/reader/reader3.php it's free and supports command line parameters
-
ghostscript
-
Thank you guys for all your ideas. I think I found myself
a solution. I am going to use Dave Fulger's DosLib.
I will use one of the "Process Functions"....dos_shellexe.
Thank you again everyone!
-
Thank you guys for all your ideas. I think I found myself
a solution. I am going to use Dave Fulger's DosLib.
I will use one of the "Process Functions"....dos_shellexe.
Thank you again everyone!
I found this old post... question: is there anyone who uses dos_shellexe to send PDFs to the printer?
-
I try with a second question: in Windows I can send PDF files directly to default printer (less then 16 without modify Win registry), how can I send PDF to printer like in Windows Explorer?
-
Studying this VBscript solution may be helpful:
http://www.robvanderwoude.com/sourcecode.php?src=printpdf_vbs
-
Studying this VBscript solution may be helpful:
http://www.robvanderwoude.com/sourcecode.php?src=printpdf_vbs
thanks for answering, after many tests I found a fairly simple solution with Acrobat Reader installed:
(setq PdfFil "Z:/Temp/Test1.pdf")
(DOS_SHELLEXE "AcroRd32.exe" (strcat "/t /h \"" PdfFil "\"") 0 3)
:-)
-
To print many PDF copies I use:
; FlsLst = List of file names
(repeat NumCopies
(foreach ForElm FlsLst
(setq FilNam (strcat PatNam ForElm))
(DOS_SHELLEXE "AcroRd32.exe" (strcat "/h /s /p \"" FilNam "\"") 0 3)
(while (DOS_OPENP FilNam) (vl-cmdf "_.DELAY" 1))
)
)
Sometimes I need to delete the files after printing but with this method the cancellation can take place before printing is complete, is there a way to execute cancellation after printing? (Dos_OpenP + delay do not works)...
(foreach ForElm FlsLst
(while (DOS_OPENP (strcat PatNam ForElm)) (vl-cmdf "_.DELAY" 1))
(DOS_DELETE (strcat PatNam ForElm))
)
Other attempt:
(setq DelFlg (DOS_MSGBOXEX "Delete the files after plot?" "Send PDF to Printer" '("No" "Yes") 4))
(DOS_GETPROGRESS "Printing" "Please wait..." 100)
(foreach ForElm FlsLst
(setq FilNam (strcat PatNam ForElm) Countr 1)
(DOS_GETPROGRESS -1)
(repeat NumCop
(DOS_SHELLEXE "AcroRd32.exe" (strcat "/h /s /p \"" FilNam "\"") 0 3)
(vl-cmdf "_.DELAY" 500)
(while (DOS_OPENP FilNam) (vl-cmdf "_.DELAY" 500))
(if (and (= NumCop Countr) (= 1 DelFlg))
(progn (DOS_DELETE FilNam) (alert (strcat FilNam "\n" (itoa Countr))))
(setq Countr (1+ Countr))
)
)
)
(DOS_GETPROGRESS T)
-
Based on these references:
http://www.robvanderwoude.com/commandlineswitches.php#Acrobat
http://two.pairlist.net/pipermail/reportlab-users/2003-January/001158.html
Have you tried something like this?:
(setq DelFlg (DOS_MSGBOXEX "Delete the files after plot?" "Send PDF to Printer" '("No" "Yes") 4))
(DOS_GETPROGRESS "Printing" "Please wait..." 100)
(foreach ForElm FlsLst
(setq FilNam (strcat PatNam ForElm))
(DOS_GETPROGRESS -1)
(repeat NumCop
(DOS_SHELLEXE "AcroRd32.exe" (strcat "/N /T \"" FilNam "\" YourPrinterName") 0 3)
(vl-cmdf "_.DELAY" 500)
(while (DOS_OPENP FilNam) (vl-cmdf "_.DELAY" 500))
)
(if (= 1 DelFlg) (DOS_DELETE FilNam))
)
(DOS_GETPROGRESS T)
-
Based on these references:
http://www.robvanderwoude.com/commandlineswitches.php#Acrobat
http://two.pairlist.net/pipermail/reportlab-users/2003-January/001158.html
Have you tried something like this?:
...
/n - Launch a new instance of Reader even if one is already open
/s - Don't show the splash screen
/o - Don't show the open file dialog
/h - Open as a minimized window
/p <filename> - Open and go straight to the print dialog
/t <filename> <printername> <drivername> <portname> - Print the file the specified printer
/N /T > now works better. Generous as always, thanks for your time. :-)
-
/N /T > now works better. Generous as always, thanks for your time. :-)
Excellent, you're welcome - note that I also removed your counter variable :wink:
-
Based on these references:
http://www.robvanderwoude.com/commandlineswitches.php#Acrobat
http://two.pairlist.net/pipermail/reportlab-users/2003-January/001158.html
Have you tried something like this?:
(setq DelFlg (DOS_MSGBOXEX "Delete the files after plot?" "Send PDF to Printer" '("No" "Yes") 4))
(DOS_GETPROGRESS "Printing" "Please wait..." 100)
(foreach ForElm FlsLst
(setq FilNam (strcat PatNam ForElm))
(DOS_GETPROGRESS -1)
(repeat NumCop
(DOS_SHELLEXE "AcroRd32.exe" (strcat "/N /T \"" FilNam "\" YourPrinterName") 0 3)
(vl-cmdf "_.DELAY" 500)
(while (DOS_OPENP FilNam) (vl-cmdf "_.DELAY" 500))
)
(if (= 1 DelFlg) (DOS_DELETE FilNam))
)
(DOS_GETPROGRESS T)
Cool