static void ProcessArgs(string[] args) { if (args.Length != 2) { ColorHelpers.WriteLineColor("Need 2 arguments!", ConsoleColor.Red); DisplayHelpText(); } else { if (args[0].EndsWith(".txt")) { // handle regular .txt file string textFile = args[0]; string destinationFile = args[1]; if (File.Exists(textFile)) { Log.Information("Processing file {textFile}", textFile); string[] imagesFromFile = File.ReadAllLines(textFile); List <string> images = new List <string>(imagesFromFile); PdfConverter.AddMultipleImagesToNewPdf(images, destinationFile); } } else if (args[0].EndsWith(".csv")) { // handle .csv file } } }
private static void RunNormalTest() { string pathToImageFolder = @"C:\Users\Prime Time Pauly G\Pictures\Downloaded Lock Screens\2019 Q2\portrait"; string imageName1 = "f98c210.jpg"; string imageName2 = "70de15f.jpg"; string imageName3 = "cc19c60.jpg"; string path1 = Path.Combine(pathToImageFolder, imageName1); string path2 = Path.Combine(pathToImageFolder, imageName2); string path3 = Path.Combine(pathToImageFolder, imageName3); List <string> images = new List <string>() { path1, path2, path3 }; string destinationFile = @"c:\temp\mytestPdf.pdf"; PdfConverter.AddMultipleImagesToNewPdf(images, destinationFile); }