示例#1
0
        protected void GenerationPdf(object sender, EventArgs e)
        {
            // templates load
            var template    = Server.MapPath("test.xml");
            var pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(template);

            // TODO fonts externes

            //  parameters load
            headerData.Add("{titreDocument}", "SERVICE DEPARTEMENTAL D'INCENDIE \nET DE SECOURS DES DEUX-SEVRES");
            headerData.Add("{logoUrl}", Server.MapPath("LogoPdf.jpg"));
            footerData.Add("{titreDocument}", "Titre du document");

            // data load
            var firstTable = new TableData
            {
                HeadData = new Hashtable(),
                LoopData = new List <Hashtable>(),
                FootData = new Hashtable()
            };
            DateTime debut = new DateTime(2016, 1, 1);

            for (int i = 0; i < 100; i++)
            {
                var donnees1 = new Hashtable
                {
                    { "{Date}", debut.AddDays(i) },
                    { "{Centre}", "Centre 1" },
                    { "{Frais}", 5 },
                    { "{Nombre}", "200,00" },
                    { "{Base}", "5,00" },
                    { "{Montant}", i }
                };
                firstTable.LoopData.Add(donnees1);
            }
            firstTable.FootData.Add("{Total}", 250.5);
            firstTable.FootData.Add("{logoUrl}", Server.MapPath("LogoPdf.jpg"));
            bodyData.Add("{FirstTable}", firstTable);

            // Here we set the condition value for conditional output
            bodyData.Add("{Condition}", Condition.Checked);

            // pdf generation
            pdfTemplate.Draw(headerData, bodyData, footerData);

            // save file locally
            string fileDirectory = Server.MapPath("../Output/");
            string fileName      = "ConditionalDisplay-" + String.Format("{0:yyyyMMdd-HHmmss}", DateTime.Now) + ".pdf";

            using (var filePdf = new FileStream(fileDirectory + fileName, FileMode.Create))
            {
                using (MemoryStream stream = pdfTemplate.Close())
                {
                    byte[] content = stream.ToArray();
                    filePdf.Write(content, 0, content.Length);
                }
            }

            Resulat.Text = "Generated PDF: <a href='../Output/" + fileName + "'>" + fileName + "</a><br/><br/><iframe src='../Output/" + fileName + "' width='1024' height='600' />";
        }
示例#2
0
        protected void GenerationPdf(object sender, EventArgs e)
        {
            randonGen = new Random();
            // templates load
            var template = Server.MapPath("test.xml");
            var pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(template);
            // TODO fonts externes 

            //  parameters load
            headerData.Add("{titreDocument}", "SERVICE DEPARTEMENTAL D'INCENDIE \nET DE SECOURS DES DEUX-SEVRES");
            headerData.Add("{logoUrl}", Server.MapPath("LogoPdf.jpg"));
            footerData.Add("{titreDocument}", "Titre du document");

            // data load
            DateTime debut = new DateTime(2016, 1, 1);
            loopTableData.Add(new Hashtable
                {
                    {"{Date}", debut.AddDays(-1)},
                    {"{Centre}", "des données qui prennent toute la ligne pour voir "}, 
                    {"{Frais}", ""},
                    {"{Nombre}", ""},
                    {"{Base}", ""},
                    {"{Montant}", ""}, 
                    {"{Background}", RandomColor()}
                });
            for (int i = 0; i < 200; i++)
            {
                var donnees1 = new Hashtable
                {
                    {"{Date}", debut.AddDays(i)},
                    {"{Centre}", "Centre 1\nMore information"},
                    {"{Frais}", 5},
                    {"{Nombre}", "200,00"},
                    {"{Base}", "5,00"},
                    {"{Montant}", i}, 
                    {"{Background}", RandomColor()}
                };
                loopTableData.Add(donnees1);
            }
            footerTableData.Add("{Total}", 250.5);

            // pdf generation
            pdfTemplate.Draw(headerData, loopData, bodyData, footerData, headerTableData, loopTableData, footerTableData);

            // save file locally
            string fileDirectory = Server.MapPath("../Output/");
            string fileName = "SimpleTest-" + String.Format("{0:yyyyMMdd-HHmmss}", DateTime.Now) + ".pdf";
            using (var filePdf = new FileStream(fileDirectory + fileName, FileMode.Create))
            {
                using (MemoryStream stream = pdfTemplate.Close())
                {
                    byte[] content = stream.ToArray();
                    filePdf.Write(content, 0, content.Length);
                }
            }

            Resulat.Text = "Generated PDF: <a href='../Output/" + fileName + "'>" + fileName + "</a><br/><br/><iframe src='../Output/" + fileName + "' width='1024' height='600' />";
        }
示例#3
0
		void Button1Click(object sender, EventArgs e)
		{
			//print
			
			try{
								
				if(this.txtTemplate.Text == null)throw new ArgumentNullException("Print Template");
				
				if(Debug){
					Console.WriteLine("Make PDF with template -> "+this.txtTemplate.Text);
				}
				
				//load
//				XmlDocument xmlDoc = new XmlDocument();
//				xmlDoc.LoadXml( this.txtTemplate.Text );
//				
				Moon.PDFTemplateItextSharp.PDFTemplateItextSharp pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp( /*xmlDoc*/this.txtTemplate.Text );
			
				//FONTS
				//iTextSharp.text.pdf.BaseFont.AddToResourceSearch("iTextAsian.dll");
            	
				// verdana font
				pdfTemplate.RegisterFont(@"C:\Windows\Fonts\verdana.ttf", "verdana", "");

				// using CJK				
				//drawer.RegisterFont("", "STSong-Light", "UniGB-UCS2-H");
				pdfTemplate.RegisterFont("", "MHei-Medium", "UniCNS-UCS2-H");
				//---
				
			   //create
				pdfTemplate.Draw( documentData, loopData, documentData, documentData ,
				                 documentData, loopData, documentData               );
			
				
				string pdfFileName = Path.GetTempFileName();
				if(pdfFileName == null)throw new NullReferenceException("PDF File Name");
				
				//save PDF
				FileStream filePDF = new FileStream(pdfFileName, FileMode.Create );
				MemoryStream stream = pdfTemplate.Close();
				byte[] content = stream.ToArray();
				filePDF.Write( content, 0, content.Length );
				filePDF.Close();
				stream.Close();				
				
				//browse
				if(this.txtViewer.Text != null || this.txtViewer.Text.Trim() != ""){
					if(Debug){
						Console.WriteLine("Showing PDF -> "+ pdfFileName);
					}
					System.Diagnostics.Process.Start(this.txtViewer.Text , pdfFileName );
				}
				
			}catch(Exception ex){
				MessageBox.Show(ex.ToString());
			}
			
		}
示例#4
0
        protected void GenerationPdf(object sender, EventArgs e)
        {
            // templates load
            var template = Server.MapPath("test.xml");
            var pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(template);
            // TODO fonts externes 

            //  parameters load
            headerData.Add("{titreDocument}", "SERVICE DEPARTEMENTAL D'INCENDIE \nET DE SECOURS DES DEUX-SEVRES");
            headerData.Add("{logoUrl}", Server.MapPath("LogoPdf.jpg"));
            footerData.Add("{titreDocument}", "Titre du document");

            // data load
            var firstTable = new TableData
            {
                HeadData = new Hashtable(),
                LoopData = new List<Hashtable>(),
                FootData = new Hashtable()
            };
            DateTime debut = new DateTime(2016, 1, 1);
            for (int i = 0; i < 100; i++)
            {
                var donnees1 = new Hashtable
                {
                    {"{Date}", debut.AddDays(i)},
                    {"{Centre}", "Centre 1"},
                    {"{Frais}", 5},
                    {"{Nombre}", "200,00"},
                    {"{Base}", "5,00"},
                    {"{Montant}", i}
                };
                firstTable.LoopData.Add(donnees1);
            }
            firstTable.FootData.Add("{Total}", 250.5);
            bodyData.Add("{FirstTable}", firstTable);

            // Here we set the condition value for conditional output
            bodyData.Add("{Condition}", Condition.Checked);

            // pdf generation
            pdfTemplate.Draw(headerData, bodyData, footerData);

            // save file locally
            string fileDirectory = Server.MapPath("../Output/");
            string fileName = "SimpleTest-" + String.Format("{0:yyyyMMdd-HHmmss}", DateTime.Now) + ".pdf";
            using (var filePdf = new FileStream(fileDirectory + fileName, FileMode.Create))
            {
                using (MemoryStream stream = pdfTemplate.Close())
                {
                    byte[] content = stream.ToArray();
                    filePdf.Write(content, 0, content.Length);
                }
            }

            Resulat.Text = "Generated PDF: <a href='../Output/" + fileName + "'>" + fileName + "</a><br/><br/><iframe src='../Output/" + fileName + "' width='1024' height='600' />";
        }
示例#5
0
        public static void TestArStatementXML()
        {
            // need to load CJK b4 create PDFTemplateItextSharp
            // itextsharp.dll 5.3.5 ok
            // itextsharp.dll 5.1.3 not ok
            //iTextSharp.text.pdf.BaseFont.AddToResourceSearch("iTextAsian.dll"); // iTextAsian.dll 2.1.0.0

            // istextsharp.dll 5.5.9 ok
            iTextSharp.text.io.StreamUtil.AddToResourceSearch("iTextAsian.dll"); // iTextAsian.dll 2.1.0.0

            Moon.PDFTemplateItextSharp.PDFTemplateItextSharp pdfTpl =
                new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(@"file\ar_statement.xml");

            //// verdana font
            pdfTpl.RegisterFont(@"C:\Windows\Fonts\verdana.ttf", "verdana", "");

            //pdfTpl.RegisterFont(@"SimSun.ttf", "Simsun", "Identity-H");

            //// using CJK
            //// no need to give path for register CJK font
            pdfTpl.RegisterFont("", "STSong-Light", "UniGB-UCS2-H");
            //pdfTpl.RegisterFont("", "MHei-Medium", "UniCNS-UCS2-H");

            pdfTpl.RegisterFont(@"c:\Windows\Fonts\arial.ttf", "Arial", "Identity-H");
            //// enable to detect Arabic and Hebrew
            pdfTpl.DetectRightToLeft = true;

            Hashtable headerData = new Hashtable();

            headerData.Add("{short_name}", "shortName");
            headerData.Add("{name}", "Name");
            headerData.Add("{address1}", "Address1 '繁體','简体'");
            headerData.Add("{address2}", "Address2");
            headerData.Add("{tel}", "Tel");

            string arabic_welcome = "أهلا وسهلا";

            headerData.Add("{fax}", arabic_welcome);

            headerData.Add("{statement_date}", "statement date");

            headerData.Add("{cus_company_name}", "cus company name");
            headerData.Add("{cus_name}", "Name");
            headerData.Add("{cus_add1}", "Address1 '繁體','简体'");
            headerData.Add("{cus_add2}", "Address2 '繁體','简体'");
            headerData.Add("{cus_add3}", "Address3 '繁體','简体'");
            headerData.Add("{cus_add4}", "Address4 '繁體','简体'");
            headerData.Add("{cus_tel}", "Tel");
            headerData.Add("{cus_fax}", "Fax");
            headerData.Add("{cus_area}", "Area");

            List <Hashtable> loopData = new List <Hashtable>();

            for (int i = 0; i < 100; i++)
            {
                Hashtable data = new Hashtable();
                data.Add("{date}", "date" + i);
                data.Add("{due_date}", "due_date" + i);
                data.Add("{reference}", "reference");
                data.Add("{type}", "type");
                data.Add("{amount}", i.ToString());
                data.Add("{balance}", i.ToString());
                loopData.Add(data);
            }

            Hashtable bodyData   = new Hashtable();
            Hashtable footerData = new Hashtable();

            footerData.Add("{tbalance}", "tbalance");

            pdfTpl.Draw(headerData, loopData, bodyData, footerData);
            //pdfTpl.Draw(headerData, loopData, bodyData, footerData, null, new List<Hashtable>(), null);

            System.IO.FileStream   file    = new System.IO.FileStream(@"Statement.pdf", System.IO.FileMode.Create);
            System.IO.MemoryStream mStream = pdfTpl.Close();
            byte[] bytes = mStream.ToArray();
            file.Write(bytes, 0, bytes.Length);
            file.Close();
            mStream.Close();
        }
示例#6
0
        protected void GenerationPdf(object sender, EventArgs e)
        {
            randonGen = new Random();
            // templates load
            var template    = Server.MapPath("test.xml");
            var pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(template);

            // TODO fonts externes

            //  parameters load
            headerData.Add("{titreDocument}", "SERVICE DEPARTEMENTAL D'INCENDIE \nET DE SECOURS DES DEUX-SEVRES");
            headerData.Add("{logoUrl}", Server.MapPath("LogoPdf.jpg"));
            footerData.Add("{titreDocument}", "Titre du document");

            // data load
            DateTime debut = new DateTime(2016, 1, 1);

            loopTableData.Add(new Hashtable
            {
                { "{Date}", debut.AddDays(-1) },
                { "{Centre}", "des données qui prennent toute la ligne pour voir " },
                { "{Frais}", "" },
                { "{Nombre}", "" },
                { "{Base}", "" },
                { "{Montant}", "" },
                { "{Background}", RandomColor() }
            });
            for (int i = 0; i < 200; i++)
            {
                var donnees1 = new Hashtable
                {
                    { "{Date}", debut.AddDays(i) },
                    { "{Centre}", "Centre 1\nMore information" },
                    { "{Frais}", 5 },
                    { "{Nombre}", "200,00" },
                    { "{Base}", "5,00" },
                    { "{Montant}", i },
                    { "{Background}", RandomColor() }
                };
                loopTableData.Add(donnees1);
            }
            footerTableData.Add("{Total}", 250.5);

            // pdf generation
            pdfTemplate.Draw(headerData, loopData, bodyData, footerData, headerTableData, loopTableData, footerTableData);

            // save file locally
            string fileDirectory = Server.MapPath("../Output/");
            string fileName      = "SimpleTest-" + String.Format("{0:yyyyMMdd-HHmmss}", DateTime.Now) + ".pdf";

            using (var filePdf = new FileStream(fileDirectory + fileName, FileMode.Create))
            {
                using (MemoryStream stream = pdfTemplate.Close())
                {
                    byte[] content = stream.ToArray();
                    filePdf.Write(content, 0, content.Length);
                }
            }

            Resulat.Text = "Generated PDF: <a href='../Output/" + fileName + "'>" + fileName + "</a><br/><br/><iframe src='../Output/" + fileName + "' width='1024' height='600' />";
        }
示例#7
0
        void Button1Click(object sender, EventArgs e)
        {
            //print

            try{
                if (this.txtTemplate.Text == null)
                {
                    throw new ArgumentNullException("Print Template");
                }

                if (Debug)
                {
                    Console.WriteLine("Make PDF with template -> " + this.txtTemplate.Text);
                }

                //load
//				XmlDocument xmlDoc = new XmlDocument();
//				xmlDoc.LoadXml( this.txtTemplate.Text );
//
                Moon.PDFTemplateItextSharp.PDFTemplateItextSharp pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(/*xmlDoc*/ this.txtTemplate.Text);

                //FONTS
                //iTextSharp.text.pdf.BaseFont.AddToResourceSearch("iTextAsian.dll");

                // verdana font
                pdfTemplate.RegisterFont(@"C:\Windows\Fonts\verdana.ttf", "verdana", "");

                // using CJK
                //drawer.RegisterFont("", "STSong-Light", "UniGB-UCS2-H");
                pdfTemplate.RegisterFont("", "MHei-Medium", "UniCNS-UCS2-H");
                //---

                //create
                pdfTemplate.Draw(documentData, loopData, documentData, documentData,
                                 documentData, loopData, documentData);


                string pdfFileName = Path.GetTempFileName();
                if (pdfFileName == null)
                {
                    throw new NullReferenceException("PDF File Name");
                }

                //save PDF
                FileStream   filePDF = new FileStream(pdfFileName, FileMode.Create);
                MemoryStream stream  = pdfTemplate.Close();
                byte[]       content = stream.ToArray();
                filePDF.Write(content, 0, content.Length);
                filePDF.Close();
                stream.Close();

                //browse
                if (this.txtViewer.Text != null || this.txtViewer.Text.Trim() != "")
                {
                    if (Debug)
                    {
                        Console.WriteLine("Showing PDF -> " + pdfFileName);
                    }
                    System.Diagnostics.Process.Start(this.txtViewer.Text, pdfFileName);
                }
            }catch (Exception ex) {
                MessageBox.Show(ex.ToString());
            }
        }
示例#8
0
        protected void GenerationPdf(object sender, EventArgs e)
        {
            randonGen = new Random();
            // templates load
            var template    = Server.MapPath("test.xml");
            var pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(template);

            // TODO fonts externes

            //  parameters load
            headerData.Add("{titreDocument}", "DOCUMENT \nTITLE");
            headerData.Add("{logoUrl}", Server.MapPath("LogoPdf.jpg"));
            footerData.Add("{titreDocument}", "Document Title");

            var nbDynamicColumns = randonGen.Next(2, 6);

            var percent = new List <int> {
                25, 50, 75, 100
            };

            // data load
            var firstTable = new TableData
            {
                DynamicColumns = new List <DynamicColumnDefinition>(),
                HeadData       = new Hashtable(),
                LoopData       = new List <Hashtable>(),
                FootData       = new Hashtable()
            };

            for (var i = 1; i <= nbDynamicColumns; i++)
            {
                firstTable.DynamicColumns.Add(new DynamicColumnDefinition
                {
                    CellWidth      = 1,
                    HeaderTemplate = "<tablecell border=\"Top, Bottom, Right\" backgroundcolor=\"#9BCFF9\"><textbox text=\"Column " + i + "\"></textbox></tablecell>",
                    DataTemplate   = "<tablecell border=\"Bottom, Right\"><textbox text=\"{Val" + i + "}\"><var name=\"{Val" + i + "}\" /></textbox></tablecell>"
                });
            }

            DateTime debut = new DateTime(2016, 1, 1);

            for (int i = 0; i < 10; i++)
            {
                var donnees1 = new Hashtable {
                    { "{Title}", "Line number " + i }
                };
                for (var j = 1; j <= nbDynamicColumns; j++)
                {
                    donnees1.Add("{Val" + j + "}", RandomData());
                }
                firstTable.LoopData.Add(donnees1);
            }
            bodyData.Add("{FirstTable}", firstTable);

            // pdf generation
            pdfTemplate.Draw(headerData, bodyData, footerData);

            // save file locally
            string fileDirectory = Server.MapPath("../Output/");
            string fileName      = "MultipleTables-" + string.Format("{0:yyyyMMdd-HHmmss}", DateTime.Now) + ".pdf";

            using (var filePdf = new FileStream(fileDirectory + fileName, FileMode.Create))
            {
                using (MemoryStream stream = pdfTemplate.Close())
                {
                    byte[] content = stream.ToArray();
                    filePdf.Write(content, 0, content.Length);
                }
            }

            Resulat.Text = "Generated PDF: <a href='../Output/" + fileName + "'>" + fileName + "</a><br/><br/><iframe src='../Output/" + fileName + "' width='1024' height='600' />";
        }
示例#9
0
        public static void TestArStatementXML()
        {

            // need to load CJK b4 create PDFTemplateItextSharp
            // itextsharp.dll 5.3.5 ok
            // itextsharp.dll 5.1.3 not ok
            //iTextSharp.text.pdf.BaseFont.AddToResourceSearch("iTextAsian.dll"); // iTextAsian.dll 2.1.0.0

            // istextsharp.dll 5.5.9 ok
            iTextSharp.text.io.StreamUtil.AddToResourceSearch("iTextAsian.dll"); // iTextAsian.dll 2.1.0.0

            Moon.PDFTemplateItextSharp.PDFTemplateItextSharp pdfTpl = 
                new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(@"file\ar_statement.xml");

            //// verdana font
            pdfTpl.RegisterFont(@"C:\Windows\Fonts\verdana.ttf", "verdana", "");

            //pdfTpl.RegisterFont(@"SimSun.ttf", "Simsun", "Identity-H");

            //// using CJK
            //// no need to give path for register CJK font
            pdfTpl.RegisterFont("", "STSong-Light", "UniGB-UCS2-H");
            //pdfTpl.RegisterFont("", "MHei-Medium", "UniCNS-UCS2-H");

            pdfTpl.RegisterFont(@"c:\Windows\Fonts\arial.ttf", "Arial", "Identity-H");
            //// enable to detect Arabic and Hebrew
            pdfTpl.DetectRightToLeft = true;

            Hashtable headerData = new Hashtable();

            headerData.Add("{short_name}", "shortName");
            headerData.Add("{name}", "Name");
            headerData.Add("{address1}", "Address1 '繁體','简体'");
            headerData.Add("{address2}", "Address2");
            headerData.Add("{tel}", "Tel");

            string arabic_welcome = "أهلا وسهلا";
            headerData.Add("{fax}", arabic_welcome);

            headerData.Add("{statement_date}", "statement date");

            headerData.Add("{cus_company_name}", "cus company name");
            headerData.Add("{cus_name}", "Name");
            headerData.Add("{cus_add1}", "Address1 '繁體','简体'");
            headerData.Add("{cus_add2}", "Address2 '繁體','简体'");
            headerData.Add("{cus_add3}", "Address3 '繁體','简体'");
            headerData.Add("{cus_add4}", "Address4 '繁體','简体'");
            headerData.Add("{cus_tel}", "Tel");
            headerData.Add("{cus_fax}", "Fax");
            headerData.Add("{cus_area}", "Area");

            List<Hashtable> loopData = new List<Hashtable>();

            for (int i = 0; i < 100; i++)
            {
                Hashtable data = new Hashtable();
                data.Add("{date}", "date" + i);
                data.Add("{due_date}", "due_date" + i);
                data.Add("{reference}", "reference");
                data.Add("{type}", "type");
                data.Add("{amount}", i.ToString());
                data.Add("{balance}", i.ToString());
                loopData.Add(data);

            }

            Hashtable bodyData = new Hashtable();
            Hashtable footerData = new Hashtable();
            footerData.Add("{tbalance}", "tbalance");

            pdfTpl.Draw(headerData, loopData, bodyData, footerData);
            //pdfTpl.Draw(headerData, loopData, bodyData, footerData, null, new List<Hashtable>(), null);

            System.IO.FileStream file = new System.IO.FileStream(@"Statement.pdf", System.IO.FileMode.Create);
            System.IO.MemoryStream mStream = pdfTpl.Close();
            byte[] bytes = mStream.ToArray();
            file.Write(bytes, 0, bytes.Length);
            file.Close();
            mStream.Close();

        }
示例#10
0
        public bool ReportePDFGenerico(string formatoXML, string rutaLogo, string rutaPDF)
        {
            bool Resultado = true;

            Hashtable headerData = new Hashtable();
            Hashtable bodyData   = new Hashtable();
            Hashtable footerData = new Hashtable();



            var pdfTemplate = new Moon.PDFTemplateItextSharp.PDFTemplateItextSharp(formatoXML);

            //  parameters load
            headerData.Add("{titreDocument}", "DOCUMENT \nTITLE");
            headerData.Add("{logoUrl}", rutaLogo);
            footerData.Add("{titreDocument}", "Document Title");

            // data load
            var firstTable = new TableData
            {
                HeadData = new Hashtable(),
                LoopData = new List <Hashtable>(),
                FootData = new Hashtable()
            };

            DateTime debut = new DateTime(2016, 1, 1);

            for (int i = 0; i < 100; i++)
            {
                var donnees1 = new Hashtable
                {
                    { "{Date}", debut.AddDays(i) },
                    { "{Centre}", "Centre 1" },
                    { "{Frais}", 5 },
                    { "{Nombre}", "200,00" },
                    { "{Base}", "5,00" },
                    { "{Montant}", i }
                };
                firstTable.LoopData.Add(donnees1);
            }

            firstTable.FootData.Add("{Total}", 250.5);
            bodyData.Add("{FirstTable}", firstTable);
            bodyData.Add("{SecondTable}", firstTable);

            // pdf generation
            //pdfTemplate.Draw(headerData,bodyData, footerData);

            pdfTemplate.Draw(headerData, firstTable.LoopData, bodyData, footerData);

            // save file locally
            string fileDirectory = rutaPDF;
            string fileName      = "MultipleTables-" + string.Format("{0:yyyyMMdd-HHmmss}", DateTime.Now) + ".pdf";

            using (var filePdf = new FileStream(fileDirectory + fileName, FileMode.Create))
            {
                using (MemoryStream stream = pdfTemplate.Close())
                {
                    byte[] content = stream.ToArray();
                    filePdf.Write(content, 0, content.Length);
                }
            }



            return(Resultado);
        }