Hi All
I need a convert a Aspose Word document to Aspose PDf document, but I am not suppose to save any file to disk at any point of time.
Steps followed:
1. Array of bytes[] info will be there is database. This bytes of data will be in Aspose Word format.
2. Now using this byte info I created a Aspose word document using memory stream as below
using ( MemoryStream meomoryStreamstream = new MemoryStream(data,true))
{
Document wordDocument = new Document(meomoryStreamstream);
Stream xmlStream = File.Create("text.xml");
wordDocument.Save(xmlStream, SaveFormat.AsposePdf);
Aspose.Pdf.Pdf pdfDocument = new Aspose.Pdf.Pdf();
pdfDocument.BindXML(xmlStream, null);
pdfDocument.IsImagesInXmlDeleteNeeded = true;
pdfDocument.Save(@"C:\Users\rchikkarangaiah\Desktop\pdf.pdf");
MemoryStream stream = new MemoryStream();
pdfDocument.Save(stream);
data = stream.GetBuffer();
}
But hete I am using "text.xml" file to strore the data from the aspose word document to Aspose pdf.
Since I shouldnt save any files to disk, what is alternative here.
pdfDocument.Save(stream);
data = stream.GetBuffer();
the 'data' which if of pdf form will be stored in data and will be shown to the user in the pdf file..
Thanks in advance
Ranganatha