usmanazizgroupdocs
8/1/2016 - 12:00 PM

RenderAsPdf.vb

' For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
' Create/initialize image handler 
Dim imageHandler As New ViewerImageHandler(Utilities.GetConfigurations())

Dim DocumentName As String = "sample.docx"
' To Apply transformations on PDF file
' options.Transformations = Transformation.Rotate | Transformation.Reorder | Transformation.AddPrintAction;

' Call GetPdfFile to get FileContainer type object which contains the stream of pdf file.
Dim container As FileContainer = imageHandler.GetPdfFile(DocumentName)

'Change the extension of the file and assign to a string type variable filename
Dim filename As [String] = Path.GetFileNameWithoutExtension(DocumentName) + ".pdf"

'Save each image at disk
Utilities.SaveFile(filename, container.Stream)