Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created October 19, 2017 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/08d76444ef53e5e946845e8e85c18a12 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/08d76444ef53e5e946845e8e85c18a12 to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// get Configurations
ViewerConfig config = Utilities.GetConfigurations();
// create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
// guid implies that unique document name
string guid = DocumentName;
PdfFileOptions options = new PdfFileOptions();
// set add print action property
options.Transformations = Transformation.AddPrintAction;
// get file as pdf with print action
FileContainer container = htmlHandler.GetPdfFile(guid, options);
// save PDF file
Utilities.SaveFile(guid, container.Stream);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment