pdfOffice is an iText 7 add-on that allows generating a PDF document from either a Word or PowerPoint file (Excel is coming soon).

Currently supported file types are: .doc, .docx, .dotx, docm, .dotm, .dot, .ppt, .pptx, .potx, .pptm, .potm, .ppsx, .ppsm, .pot, and .pps.

The example below demonstrates converting a Word document (.docx) into a PDF.

import com.itextpdf.licensekey.LicenseKey; import com.itextpdf.pdfoffice.OfficeConverter; import com.itextpdf.pdfoffice.OfficeDocumentConverterProperties; import com.itextpdf.pdfoffice.OfficePageRange; import java.io.File; import java.io.IOException; public class Office { public static void main(String[] args) throws IOException { LicenseKey.loadLicenseFile("license.xml"); File pdfOutFile = new File("out_office.pdf"); File demoFile = new File("input.docx"); // converts pages between 1 to 8 OfficeConverter.convertOfficeDocumentToPdf(demoFile, pdfOutFile, new OfficeDocumentConverterProperties() .setPageRange(new OfficePageRange().addPageSequence(1, 8))); } }
pdfOffice is not available yet for C#