public void ParseSamplePasses()
        {
            var passes = System.IO.Directory.EnumerateFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SamplePasses"), "*.pkpass");

            foreach (var file in passes)
            {
                PassKit.Parse(file);
            }
        }
示例#2
0
        public void ParseSamplePasses()
        {
            var passes = System.IO.Directory.EnumerateFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SamplePasses"), "*.pkpass");

            foreach (var file in passes)
            {
                var pass = PassKit.Parse(file);

                var html     = pass.ToHtml();
                var fileName = Path.GetFileName(file);
                File.WriteAllText($"D:\\result.{fileName}.html", html);
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            var pk = PassKit.Parse(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "costco.pkpass"));

            Console.WriteLine(pk.Barcode.Message);

            var cert = new System.Security.Cryptography.X509Certificates.X509Certificate2(
                Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testpass.p12"), "password");

            var outFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testoutput.pkpass");

            try { File.Delete(outFile); } catch { }

            pk.Write(outFile, cert);

            Console.WriteLine("OK");
        }
示例#4
0
        ////////////////////////////////////////////////////////////////////
        // Create article's example test PDF document
        ////////////////////////////////////////////////////////////////////

        public TicketPdfMaker(string pkpassfile)
        {
            pk = PassKit.Parse(pkpassfile);
            Console.WriteLine(pk.Barcode.Message);
        }