I want to convert docx file to pdf.
I have tried microsoft office interop but it doesn't work without office.
Is there any other way to convert docx file into pdf ?(using .net free library)
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Jan 18, 2021, 11:44 AM EST
Tina Tang127 reputationPosted Jan 18, 2021, 8:57 PM EST
Prince Jain141 reputationPosted Jan 18, 2021, 1:08 PM EST
Ben ThompsonRank #8,839 · 215 reputationPosted Jan 18, 2021, 5:25 PM EST
Prince Jain141 reputationPosted Jan 19, 2021, 1:43 AM EST
Prince Jain141 reputationPosted Jan 19, 2021, 5:02 AM EST
I am refering below url
https://www.c-sharpcorner.com/UploadFile/698727/convert-word-file-to-pdf-using-C-Sharp/
Marvin ReidRank #1,963 · 746 reputationPosted Sep 26, 2022, 4:48 PM EDT
You can use the DocumentConverter class to convert the DOCX files to PDF. Here is an example:
using (DocumentConverter documentConverter = new DocumentConverter()) { var input = @"C:\Inputfiles\input.docx"); var output = @"C:\Outputfiles\output.pdf"); var jobData = DocumentConverterJobs.CreateJobData(input, output, DocumentFormat.Pdf); jobData.JobName = "pdf converter"; var documentWriter = new DocumentWriter(); documentConverter.SetDocumentWriterInstance(documentWriter); var renderingEngine = new AnnWinFormsRenderingEngine(); documentConverter.SetAnnRenderingEngineInstance(renderingEngine); var job = documentConverter.Jobs.CreateJob(jobData); documentConverter.Jobs.RunJob(job); }https://www.leadtools.com/help/sdk/v22/tutorials/dotnet-console-convert-files-with-the-document-converter.html