static void Main(String[] args) { Console.WriteLine("Image Export sample:"); using (Library lib = new Library()) { Console.WriteLine("Initialized the library."); String sInput = "../../Resources/Sample_Input/ducky.pdf"; if (args.Length > 0) { sInput = args[0]; } Console.WriteLine("Input file: " + sInput); Document doc = new Document(sInput); ExportDocumentImages expdoc = new ExportDocumentImages(); expdoc.export_doc_images(doc); } }
static void Main(String[] args) { if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform .OSX) && !System.IO.File.Exists("/usr/local/lib/libgdiplus.dylib")) { Console.WriteLine("Please install libgdiplus first to access the System.Drawing namespace on macOS."); return; } if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform .Linux) && !System.IO.File.Exists("/usr/lib64/libgdiplus.so") && !System.IO.File.Exists("/usr/lib/libgdiplus.so")) { Console.WriteLine("Please install libgdiplus first to access the System.Drawing namespace on Linux."); return; } Console.WriteLine("Image Export sample:"); // ReSharper disable once UnusedVariable using (Library lib = new Library()) { Console.WriteLine("Initialized the library."); String sInput = Library.ResourceDirectory + "Sample_Input/ducky.pdf"; if (args.Length > 0) { sInput = args[0]; } Console.WriteLine("Input file: " + sInput); Document doc = new Document(sInput); ExportDocumentImages expdoc = new ExportDocumentImages(); expdoc.export_doc_images(doc); } }