Ejemplo n.º 1
0
        static void CreateSimpleReport()
        {
            using (LatexRazorRenderer renderer = new RazorTex.LatexRazorRenderer())
            {
                var report = CreateBogusReport();

                List<string> additionalNamespaces = new List<string>();
                additionalNamespaces.Add("Sample");
                renderer.TemplatePath = _templatePath;
                string latexString = renderer.Render(report, additionalNamespaces);

                PdfRenderer pdfRenderer = new PdfRenderer();
                pdfRenderer.RenderPdf(report.Id, latexString);
                Console.WriteLine("Created sample report w/ id {0}", report.Id);
            }
        }
Ejemplo n.º 2
0
        static void CreateItinerary()
        {
            using (LatexRazorRenderer renderer = new RazorTex.LatexRazorRenderer())
            {
                var itinerary = CreateBogusItinerary();

                List<string> additionalNamespaces = new List<string>();
                additionalNamespaces.Add("Sample");
                renderer.TemplatePath = _templatePath;
                string latexString = renderer.Render(itinerary, additionalNamespaces);

                PdfRenderer pdfRenderer = new PdfRenderer();
                pdfRenderer.RenderPdf(itinerary.Id, latexString);
                Console.WriteLine("Created sample itinerary w/ id {0}", itinerary.Id);
            }
        }