Hello
Every time that I think I got something right, something happens lol... argh!
Now I am trying to simply convert a word document to a pdf and render it to the browser. When I do so, the converted PDF doesn't has the word document footer.
Here is my method:
private int ConvertShowPDF(WordDocument RevisionWordDocument)
{
RevisionWordDocument.ChartToImageConverter = new ChartToImageConverter();
DocToPDFConverter converter = new DocToPDFConverter();
try
{
PdfDocument pdfDocument = converter.ConvertToPDF(RevisionWordDocument);
MemoryStream pdfStream = new MemoryStream();
pdfDocument.Save(pdfStream);
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", "inline; filename=RevisionesAdministrativas.PDF");
HttpContext.Current.Response.AddHeader("content-length", pdfStream.Length.ToString());
HttpContext.Current.Response.BinaryWrite(pdfStream.ToArray());
HttpContext.Current.Response.End();
pdfDocument.Close();
RevisionWordDocument.Save(HttpContext.Current.Server.MapPath("~/App_Data/Edited.docx"), FormatType.Docx);
RevisionWordDocument.Close();
return 0;
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return 1;
}
}
I attached to this message a copy of the word document.
What I am doing wrong?? This is some kind of bug? Help please. Thank you!
Attachment:
RevisionesAdministrativasMultiples_e37a0bdf.rar