Related Article(s):
Last active
January 28, 2023 13:34
-
-
Save GroupDocsGists/ab364dcdad8e9b4badfa0bd14484c8d5 to your computer and use it in GitHub Desktop.
View Word Documents as PDF using C#
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
// How to view Word Documents as PDF using C# | |
using GroupDocs.Viewer.Options; | |
... | |
using (Viewer viewer = new Viewer("path/document.docx")) | |
{ | |
PdfViewOptions options = new PdfViewOptions("path/Word-Document.pdf"); | |
viewer.View(options); | |
} |
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
// How to view Word Documents as Protected PDF using C# | |
using GroupDocs.Viewer.Options; | |
... | |
using (Viewer viewer = new Viewer("path/document.docx")) | |
{ | |
Security security = new Security | |
{ | |
DocumentOpenPassword = "opening-pass", | |
PermissionsPassword = "permission-pass", | |
Permissions = Permissions.AllowAll ^ Permissions.DenyPrinting | |
}; | |
PdfViewOptions options = new PdfViewOptions("path/Word-Document.pdf") | |
{ | |
Security = security | |
}; | |
viewer.View(options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment