Recently I had written an article about this topic, that covers how you can create a PDF from different format of documents (including HTML format). You can read the article here, http://www.c-sharpcorner.com/UploadFile/201fc1/spire-doc-net-library-for-cross-file-format-document-creati/
Rehan Suleman4 reputationPosted Oct 1, 2015, 6:33 AM EDT
+1
If you have MS Office with at least the Office 2007 Save as PDF add-in, you can try to use the Microsoft.Office.Interop.Word methods to load the Word files by code and save as PDF. If you don't have Office installed, you can use a library that doesn't depend on Office for loading Word files and saving PDF like leadtools or OpenOffice. For example on both libraries, see these links: http://www.codeproject.com/Articles/852084/Converting-and-Viewing-Documents-with-LEADTOOLS
There are multiple options you can pick which will allow you to take a file and convert it to PDF; however, you will run into a limitation with certain file types as the scope of what file types are supported in solutions is limited. A solution you can look into using is the DocumentConverter provided in the LEADTOOLS SDK which will allow you to take over 150 different formats and convert them into a searchable PDF. You can try the following code to perform this conversion.
Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Sep 18, 2015, 2:47 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 18, 2015, 10:01 PM EDT
Van Lai192 reputationPosted Sep 21, 2015, 7:39 PM EDT
Rehan Suleman4 reputationPosted Oct 1, 2015, 6:33 AM EDT
If you don't have Office installed, you can use a library that doesn't depend on Office for loading Word files and saving PDF like leadtools or OpenOffice. For example on both libraries, see these links:
http://www.codeproject.com/Articles/852084/Converting-and-Viewing-Documents-with-LEADTOOLS
http://www.codeproject.com/Articles/11466/Document-conversion-with-OpenOffice
Marvin ReidRank #1,963 · 746 reputationPosted Jul 28, 2021, 2:39 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts