Drucken ohne FileSaveAs Dialog, sondern Vorgabe der Ausgebedruckdatei

  • Moin,

    ich möche eine PDF drucken, aber ohne FileSaveAs Dialog.

    Der Pfad und Name der Ausgebedruckdatei soll vorgegeben werden.

    Wie gedruckt wird, ist mir egal.

    Ich habe es mit Acrobat COM versucht.

    Vielleicht gibt es einen Weg mit:?

    ShellExecute (@ScriptDir & "\" & "test.txt", "", "", "print", @SW_HIDE)

    Habt ihr eine Idee?

    Spoiler anzeigen

    $fileIn = "E:\Test.pdf" ;; state the full path of the file to print

    $App = ObjCreate("AcroExch.App") ;; start Adobe Acrobat

    ;$App.Show ;; show Acrobat or comment out for hidden mode

    $AVDoc = ObjCreate("AcroExch.AVDoc") ;; connect to Ac Viewer

    $AVDoc.Open($fileIn,"") ;; Open a file into viewer

    $PDDoc = $AVDoc.GetPDDoc ;; Get the Doc opened in the viewer

    $JSO = $PDDoc.GetJSObject ;; Connect to Acrobat JS

    $JSO.app.alert("Hi, file is open.Press Ok for printing") ;; Display a MsgBox

    ;$JSO.print("bUI","nStart","nEnd","bSilent","bShrinkToFit",..)

    $nEnd=$jso.numPages-1 ;;$nEnd zeroBase

    $JSO.print(False,0,$nEnd,False,True) ;; print with some options

    $JSO.closeDoc(True) ;; close active document

    $App.CloseAllDocs ;; - or - close all docs

    $App.exit