Try some codes:
Document doc = new Document("resume.doc");
for (int pageIndex = 0; pageIndex < doc.PageCount; pageIndex++)
{
PdfSaveOptions options = new PdfSaveOptions();
options.PageIndex = pageIndex;
options.PageCount = 1;
doc.Save(string.Format("out_{0}.pdf", pageIndex), options);
}
Or
Document doc = new Document("C:\\Temp\\Kane_International_Tax_Spring_2011.docx");
doc.Save("C:\\Temp\\out.pdf");
or the following code:
Document doc = new Document("C:\\Temp\\Kane_International_Tax_Spring_2011.docx");
PdfSaveOptions options = new PdfSaveOptions();
options.PageCount = 1;
for (int pageIndex = 0; pageIndex < doc.PageCount; pageIndex++)
{
string outputFileName = string.Format("{0}\\{1}_{2}.pdf", "C:\\Temp", "Test", pageIndex + 1);
options.PageIndex = pageIndex;
doc.Save(outputFileName, options);
}
Convert a Word Document to PDF[
^]
Creating PDF Documents in ASP.NET[
^]
Convert Word-Documents to PDF on an ASP.NET Server[
^]
Detailed discussion with code[
^]