Last active
March 15, 2018 01:51
-
-
Save fzhenmei/019c470fe55ce51d7e39459ef66425a1 to your computer and use it in GitHub Desktop.
convert the word document .docx to pdf in .net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.codeproject.com/Questions/346784/How-to-convert-word-document-to-pdf-in-Csharp | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
using Microsoft.Office.Interop.Word; | |
public partial class Default2 : System.Web.UI.Page | |
{ | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application(); | |
wordDocument = appWord.Documents.Open(@"D:\desktop\xxxxxx.docx"); | |
wordDocument.ExportAsFixedFormat(@"D:\desktop\DocTo.pdf", WdExportFormat.wdExportFormatPDF); | |
} | |
public Microsoft.Office.Interop.Word.Document wordDocument { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment