I want to convert word document to pdf in .netcore. I did that in .net4.5 ,but I need it in .netcore Without installation MicroSoft Office because i host my application on linux.
Asked
Active
Viewed 2,892 times
0
-
You can try using [Open XML SDK](https://learn.microsoft.com/en-us/office/open-xml/open-xml-sdk) – Muhammad Hannan Sep 30 '20 at 14:50
-
You could refer to the answer here:https://stackoverflow.com/a/46658645/11398810 – Rena Oct 01 '20 at 05:22
-
Muhammad hannan Do you have any example to do that – Suhail Keyjani Oct 02 '20 at 10:33
-
Rena in your referance i have to install Microsoft Office but i have linux server – Suhail Keyjani Oct 02 '20 at 10:35
1 Answers
0
You might need to consider using a .NET Standard library that supports conversion to PDF.
One approach that I am familiar with (as I work for the vendor of the toolkit) is the LEADTOOLS Document Conversion SDK.
The .NET Core library has a DocumentConverter class that can be used to convert to PDF:
using (DocumentConverter documentConverter = new DocumentConverter())
{
var format = DocumentFormat.Pdf;
var jobData = DocumentConverterJobs.CreateJobData(inFile, outFile, format);
jobData.JobName = "conversion job";
var job = documentConverter.Jobs.CreateJob(jobData);
documentConverter.Jobs.RunJob(job);
}

Hussam Barouqa
- 61
- 3