示例#1
0
 /// <summary>
 /// Generates a PDF file from the specified xml to the specified output stream.
 /// </summary>
 /// <param name="xml">Input xml.</param>
 /// <param name="output">Output stream.</param>
 public static void GeneratePdf(string xml, Stream output)
 {
     using (MemoryStream inputStream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
     {
         FODocument foDocument = new FODocument();
         foDocument.Settings.SubsetFonts        = true;
         foDocument.Settings.EmbedTrueTypeFonts = true;
         foDocument.generate(inputStream, output, false);
     }
 }
示例#2
0
        public void XSLtoPDF()
        {
            FileStream xml = new FileStream(@"D:\Studia\PKCK\git\PKCK\Task 5\SklepRowerowyApp\SklepRowerowyApp\Dokumenty\testDokumentPomocniczy.xml", FileMode.Open);

            FileStream xsl = new FileStream(@"D:\Studia\PKCK\git\PKCK\Task 5\SklepRowerowyApp\SklepRowerowyApp\Dokumenty\XSLtoPDF.xsl", FileMode.Open);
            FileStream pdf = new FileStream(@"D:\Studia\PKCK\git\PKCK\Task 5\SklepRowerowyApp\SklepRowerowyApp\Dokumenty\PDF.pdf", FileMode.Create);

            var doc = new FODocument();

            doc.generate(xml, xsl, pdf);

            MessageBox.Show("Sukces!");
        }