31. Oktober 2018 13:23
ProcessStartInfo := ProcessStartInfo.ProcessStartInfo(Path);
WITH ProcessStartInfo DO BEGIN
Verb := 'Print';
CreateNoWindow := TRUE;
WindowStyle := ProcessWindowStyle.Hidden;
END;
Process.Start(ProcessStartInfo);
31. Oktober 2018 13:41
31. Oktober 2018 13:53
31. Oktober 2018 14:00
31. Oktober 2018 14:09
31. Oktober 2018 14:18
31. Oktober 2018 15:00
31. Oktober 2018 15:35
OBJECT Codeunit 50507 Print Document
{
OBJECT-PROPERTIES
{
Date=20.04.12;
Time=08:07:15;
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnRun=VAR
FileName@1000000000 : Text[250];
BEGIN
FileName := 'c:\Temp\Demo.pdf';
PrintDocument(FileName, '', 10000);
END;
}
CODE
{
PROCEDURE PrintDocument@1000000001(FileName@1000000000 : Text[250];PrinterName@1000000003 : Text[250];TimeoutInMs@1000000004 : Integer);
VAR
Process@1000000002 : DotNet "'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.Process" RUNONCLIENT;
StartInfo@1000000001 : DotNet "'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.ProcessStartInfo" RUNONCLIENT;
PrinterSettings@1000000005 : DotNet "'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.Drawing.Printing.PrinterSettings" RUNONCLIENT;
BEGIN
IF PrinterName = '' THEN BEGIN
// Falls kein Drucker angegeben, den Standarddrucker verwenden
PrinterSettings := PrinterSettings.PrinterSettings;
PrinterName := PrinterSettings.PrinterName;
END;
StartInfo := StartInfo.ProcessStartInfo;
StartInfo.Verb := 'PrintTo';
StartInfo.FileName := FileName;
StartInfo.Arguments := '"' + PrinterName + '"';
Process := Process.Process;
Process.StartInfo := StartInfo;
Process.Start;
IF NOT Process.WaitForExit(TimeoutInMs) THEN BEGIN
Process.Kill;
END;
END;
BEGIN
END.
}
}