static void Main(string[] args) { Console.WriteLine("Image Embed ICC Profile sample:"); using (Library lib = new Library()) { Console.WriteLine("Initialized the library."); String sInput = "../../Resources/Sample_Input/ducky.pdf"; String profileName = "../../Resources/Sample_Input/Probev1_ICCv2.icc"; Console.WriteLine("Input file: " + sInput + " will have profile " + profileName + " applied."); if (args.Length > 0) { sInput = args[0]; } if (args.Length > 1) { profileName = args[1]; } Document doc = new Document(sInput); ExportDocumentImages expdoc = new ExportDocumentImages(); FileStream profileFileStream = new FileStream(profileName, FileMode.Open); PDFStream profilePDFStream = new PDFStream(profileFileStream, doc, null, null); expdoc.export_doc_images(doc, profilePDFStream); } }
static void Main(string[] args) { if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform .OSX) && !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 Embed ICC Profile sample:"); // ReSharper disable once UnusedVariable using (Library lib = new Library()) { Console.WriteLine("Initialized the library."); String sInput = Library.ResourceDirectory + "Sample_Input/ducky.pdf"; String profileName = Library.ResourceDirectory + "Sample_Input/Probev1_ICCv2.icc"; Console.WriteLine("Input file: " + sInput + " will have profile " + profileName + " applied."); if (args.Length > 0) { sInput = args[0]; } if (args.Length > 1) { profileName = args[1]; } Document doc = new Document(sInput); ExportDocumentImages expdoc = new ExportDocumentImages(); FileStream profileFileStream = new FileStream(profileName, FileMode.Open); PDFStream profilePDFStream = new PDFStream(profileFileStream, doc, null, null); expdoc.export_doc_images(doc, profilePDFStream); } }