Generate PDF from XML + XSL

Generate PDF
7/7/2014

This code sample shows how to convert XSL and XML to PDF using TallPDF.NET

1 // Load XML 2 XmlDocument xml = new XmlDocument(); 3 xml.Load( "data.xml" ); 4 5 // Load XSL 6 XslTransform xsl = new XslTransform(); 7 xsl.Load( "transform.xsl" ); 8 9 // Transform 10 XmlReader reader = xsl.Transform( xml, null ); 11 12 // Write PDF 13 Document doc = new Document(); 14 doc.Read( reader ); 15 16 using( FileStream file = new FileStream( "out.pdf", FileMode.Create, FileAccess.ReadWrite ) ) 17 { 18 doc.Write( file ); 19 }