I need to convert word file to pdf.
I am using openxml to create word file and save. Now I need to convert that file to pdf without using third party software, dll or library. How can I convert it using openxml?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mohammad HussainPosted Aug 24, 2023, 4:36 AM
You could use the Microsoft Office Interop libraries to automate Microsoft Word to open the document and then save it as a PDF. However, this approach requires Microsoft Word to be installed on the machine running the code, and it's generally not recommended for server-side applications due to potential reliability and licensing issues.
Abhishek YadavPosted Aug 22, 2023, 1:03 AM
https://stackoverflow.com/questions/607669/how-do-i-convert-word-files-to-pdf-programmatically
Darshan PatelPosted Aug 21, 2023, 12:14 PM
its not easy to found the proper library but i found this and its working i hope its usefull to you
download this library manually and install in nuget package
then store this in "C:\Program Files (x86)\Microsoft SDKs\NuGetPackages"itext.8.0.1.nupkg
itext.bouncy-castle-adapter.8.0.1.nupkg
its availble on this path
https://github.com/itext/itext7-dotnet/releases/tag/8.0.1
i hope this is usefull
Mohamed AbedallahPosted Aug 22, 2019, 9:04 AM
Using LEADTOOLS, the code is simple and similar to this:
For more info see this page:
https://www.leadtools.com/sdk/document/document-converter
If you don’t use library directly in your application, you can use the cloud services for converting word to PDF, see this link:
https://services.leadtools.com/documentation/api-reference/convert
Smart MediaPosted Aug 15, 2019, 9:32 PM
For converting DOCX to PDF even with placeholders, I have created a free "Report-From-DocX-HTML-To-PDF-Converter" library with .NET CORE under the MIT license, because I was so unnerved that no simple solution existed and all the commercial solutions were super expensive. You can find it here with an extensive description and an example project: https://github.com/smartinmedia/Net-Core-DocX-HTML-To-PDF-Converter
It can perform these conversions (alongside a template / report engine, which replaces placeholders):
You can add placeholders for:
Piyush PansuriyaPosted Jan 8, 2019, 11:39 PM
Sapna GirishPosted Jan 8, 2019, 7:13 PM
Piyush PansuriyaPosted Jan 8, 2019, 7:55 AM
Satyendra PatelPosted Jan 8, 2019, 7:25 AM