Document doc = new Document();
doc.LoadFromFile(string fileName);
doc.SaveToFile(string fileName,FileFormat.PDF);
diptiranjan.s wrote:I use the below code it
string fileName = Server.MapPath("images/DiptiRanjan.docx");
Document doc = new Document();
doc.LoadFromFile(fileName);
doc.SaveToFile(fileName, FileFormat.PDF);
first time it executes without resulting nothing.2nd time it gives an exception on(doc.LoadFromFile(fileName);) line saying below line.
Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt.
diptiranjan.s wrote:how can i send ? here the extenssion "docx" is not allowed.
Document doc = new Document();
doc.LoadFromFile(Server.MapPath("file/DiptiRanjan.docx"));
doc.SaveToFile("DiptiRanjan.pdf", FileFormat.PDF, Response, HttpContentType.Attachment);