Convert only 1st Word document page to PDF
Solution 1
Use the SaveasPdf option and save the entire document to Pdf. To get the first page you can use PDFSharp opensource library for processing PDF using C#.
Here is an example to split pdf documents.
Solution 2
You can click on Save As, change the type to PDF, and above the "save" button, you have an option button. Click on that, and you should have the choice to select which pages you want to convert to PDF.
Solution 3
In case it's helpful for someone, in Word 2016, select Save As option, choose PDF as the file format, on this same window once you've done this a new button 'Options' then will appear to the left of the OK button, click on this and choose the page range that you want save.
inquisitive_one
Updated on April 04, 2020Comments
-
inquisitive_one about 4 years
I'm using Office 2010 interop and C# 4. How can I convert just the 1st page of a word document to PDF? This question ("How do I convert Word files to PDF programmatically?") helped me to get started but it only shows me how to save the whole document as PDF.
Is there a way:
- to save just the 1st page as PDF? (most ideal option)
- delete all remaining pages and then save as PDF?
How do I go about doing it?
-
ziMtyth over 6 yearsI believe this answer should be approved not the 1st one.
-
Stephen Kennedy about 6 yearsI believe the OP was looking for a programmatic solution using C#
-
Stephen Kennedy about 6 yearsThe OP was looking for a programmatic solution using C#
-
AIMEN BOULAHIA over 3 yearsdoes it work in a Farm Solution deployed to SP Farm ? becaues in my side it's not working, it just return Null !