Example #1
0
        private static string[] GetPosibleConversions(string documentExtension)
        {
            PossibleConversions conversions = Converter.GetPossibleConversions(documentExtension);
            var conversionsFormats          = new List <string>();

            foreach (var conversion in conversions.All)
            {
                conversionsFormats.Add(conversion.Format.Extension);
            }

            conversionsFormats.Sort();

            return(conversionsFormats.ToArray());
        }
Example #2
0
        public static void Run()
        {
            PossibleConversions conversions = Converter.GetPossibleConversions("docx");

            Console.WriteLine("{0} could be converted to:", conversions.Source.Extension);

            foreach (var conversion in conversions.All)
            {
                Console.WriteLine("\t {0} as {1} conversion.", conversion.Format,
                                  conversion.IsPrimary ? "primary" : "secondary");
            }


            Console.WriteLine("\nPossible conversions retrieved successfully.");
        }
Example #3
0
        public static void Run()
        {
            using (Converter converter = new Converter(Constants.SAMPLE_DOCX))
            {
                PossibleConversions conversions = converter.GetPossibleConversions();

                Console.WriteLine("{0} is of type {1} and could be converted to:", Constants.SAMPLE_DOCX, conversions.Source.Extension);

                foreach (var conversion in conversions.All)
                {
                    Console.WriteLine("\t {0} as {1} conversion.", conversion.Format, conversion.IsPrimary?"primary": "secondary");
                }
            }

            Console.WriteLine("\nPossible conversions retrieved successfully.");
        }