i want to convert xml file to pdf file in c#.
this is my code.
private void printAllDataReceiveToolStripMenuItem_Click(object sender, EventArgs e)
{
// Load the FO style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("bookFo.xsl");
// Execute the transform and output the results to a file.
xslt.Transform("books.xml", "books.fo");
}
private void GeneratePDF(string foFile, string pdfFile)
{
FileInputStream streamFO = new FileInputStream(foFile);
InputSource src = new InputSource(streamFO);
FileOutputStream streamOut = new FileOutputStream(pdfFile);
Driver driver = new Driver(src, streamOut);
driver.setRenderer(1);
driver.run();
streamOut.close();
}
however, FileInputStream, InputSource and FileOutputStream shows the error
The type or namespace name 'FileInputStream', InputSource, FIleOutputStream could not be found (are you missing a using directive or an assembly reference?)
this is how i import things (i do not know the right terms for it)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Timers;
using System.Net.Sockets;
using System.Threading;
using System.Net;
//add data to xml
using System.Xml;
using System.Xml.Linq;
//convert to pdf
using System.Xml.Xsl;
using System.Xml.XPath;
using System.IO;
i have been searching through the internet and it said i should add this.
using org.apache.fop;
using org.apache.fop.apps;
using org.apache.fop.tools;
using org.xml.sax;
using java.io;
even i am using this, it saying the same error missing using directive or an assembly reference. can anyone help me with this?