Program.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) 2012-2020 fo-dicom contributors.
  2. // Licensed under the Microsoft Public License (MS-PL).
  3. using System;
  4. using Dicom.Log;
  5. using Dicom.Printing;
  6. namespace Print_SCP
  7. {
  8. internal static class Program
  9. {
  10. private static void Main(string[] args)
  11. {
  12. // Initialize log manager.
  13. LogManager.SetImplementation(ConsoleLogManager.Instance);
  14. //This is a simple DICOM Print SCP implementation with Print Job and Send Event Report Support
  15. //This sample depends on the Microsoft XPS Document Writer Printer to be installed on the system
  16. //You are free to use what ever printer you like by modifying the PrintJob DoPrint method hard coded
  17. //printer name
  18. //All print jobs will be created to the exe folder under a folder named PrintJobs
  19. var port = args != null && args.Length > 0 && int.TryParse(args[0], out int tmp) ? tmp : 8000;
  20. Console.WriteLine($"Starting print SCP server with AET: PRINTSCP on port {port}");
  21. PrintService.Start(port, "PRINTSCP");
  22. Console.WriteLine("Press any key to stop the service");
  23. Console.Read();
  24. Console.WriteLine("Stopping print service");
  25. PrintService.Stop();
  26. }
  27. }
  28. }