4D Tech mailing list wrote
> Hi All,
> 
> We have a need to send existing PDF documents to print (paper) without a
> user’s input.  Programmatically we would select the appropriate PDF, set
> the appropriate printer, and print.  Is anyone doing this via 4D with
> success?   Would you be willing to share your technique?
> 
> Thanks,
> Kirk

Kirk,

I use this since years:

C_TEXT($1;$errText;$vt_pfad;$POSIXPath)
$vt_pfad:=$1

If (Test path name($vt_pfad)=Is a document)
        If (Folder separator#":")
                $errText:=sys_ShellExecute ("print";$vt_pfad;"";"";1)
                DELAY PROCESS(Current process;60*5)
                If ($errText#"")
                        ALERT("Error: "+$errText)
                End if 
        Else 
                $POSIXPath:=Replace string($vt_pfad;":";"/")
                LAUNCH EXTERNAL PROCESS("lp \"/Volumes/"+$POSIXPath+"\"")
        End if 
Else 
        ALERT("Document not found: "+$vt_pfad+" !")
End if 


Armin




--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to