Microsoftofficeinteropword save as pdf c. Check out convert a document to pdf for word 2013 steps. In the file name box enter a name for the file if you. Click the file tab. Step 8 save build and run the code.
To use pathgetextension you should include systemio in the project. C code to convert docx to pdf using microsoftofficeinteropword wordpdfconvertcs. This information also applies to microsoft word starter 2010. Ie the prg has to go the specific path n if there is any word document it has to get converted to pdf.
Truth to be told it wasnt that trivial back in the day. Then the pdf file will be generated in the folder location. Until the release of office 2010 when the pdf extension appeared among the various formats supported by the save as command using ghostscript based software or installing pdf printer drivers was the only way to go. Sample c code for using pdftron sdk to convert office documents to pdf including word excel powerpoint and publisher without needing any external dependencies or ms office licenses.
To see the save as dialog box in word 2013 you have to choose a location and folder.