Hi All
I had created a Microsoft 2007 docx output via OpenXML but now i want to change this output in PDF format.
Docx contain header,footer,various pages with graphical images as well as too much formatting.
So please suggest is there any possibility that I can convert the docx to pdf just by changing the Headers.
Using :Visual Studio 2010 Ultimate
3.5 framework
and C#.net for website project.
Below is the code which I tried to do the same:
var resultname = Server.MapPath("App_data/doc/" + timeSpan + ".pdf");
using (var mainDoc = WordprocessingDocument.Open(filename, false))
using (var resultDoc = WordprocessingDocument.Create(resultname,WordprocessingDocumentType.Document))
{
foreach (var part in mainDoc.Parts)
resultDoc.AddPart(part.OpenXmlPart, part.RelationshipId);
}
But it is giving me Unable to open file,Might corrupt.
Please suggest....
Thanks in Advance!!
Regards
Mahendra Varandani