VB.NET: Online Guide
How To: PDF SDK
Convert Word, Excel, PowerPoint to PDF
Convert Word, Excel, PowerPoint to PDF
  |  
Home ›› XDoc.PDF ›› VB.NET PDF: MS Office to PDF

VB.NET PDF - Convert Word, Excel and PPT to PDF


VB.NET Tutorial for Converting MS Office Word, Excel and PowerPoint to PDF



Look for HTML5 PDF Editor?

EdgePDF: ASP.NET PDF Editor is the best HTML5 PDF Editor and ASP.NET PDF Viewer based on XDoc.PDF, JQuery, HTML5. It supports ASP.NET MVC and WebForms projects.


MS Office to PDF Conversion Overview



By integrating RasterEdge XDoc.PDF SDK into your VB.NET project, Microsoft Office such as Word, Excel, and PowerPoint can be converted to PDF document. Generally speaking, following conversion types are supported.


From MS-DOC and MS-DOCX to PDF


From MS-XLS and MS-XLSX to PDF


From MS-PPT and MS-PPTX to PDF



VB.NET Demo Code  for Converting Word to PDF



Following is VB.NET demo code for Word (.docx) to PDF conversion.




Dim inputFilePath As String = Program.RootPath + "\\" + "1.docx"
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"

' Load a Word (.docx) document.
Dim doc As DOCXDocument = New DOCXDocument(inputFilePath)

' Convert it to PDF document.
doc.ConvertToDocument(DocumentType.PDF, outputFilePath)





VB.NET Demo Code  for Converting Excel to PDF



This is a VB.NET class example for Excel (.xlsx) to PDF conversion.




Dim inputFilePath As String = Program.RootPath + "\\" + "1.xlsx"
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"

' Load an Excel (.xlsx) file.
Dim doc As XLSXDocument = New XLSXDocument(inputFilePath)

' Convert Excel to PDF.
doc.ConvertToDocument(DocumentType.PDF, outputFilePath)





VB.NET Demo Code  for Converting PowerPoint to PDF



Following sample code may help you with converting PowerPoint to PDF file.




Dim inputFilePath As String = Program.RootPath + "\\" + "1.pptx"
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"

' Load a PowerPoint (.pptx) file.
Dim doc As PPTXDocument = New PPTXDocument(inputFilePath)

' Convert it to a PDF.
doc.ConvertToDocument(DocumentType.PDF, outputFilePath)