There are some third party SDK's which give support for the .Net Core. One of them is ByteScout. You can use their SDK and can generate PDF in .Net core. You can find the sample code under this link.
If you want to do this without using any additional libraries in your project, you can try LEADTOOLS Cloud Services that support conversion to different document formats through native .NET classes, JavaScript (Node.js) and others.
The following code shows how you can submit a conversion request using C#:
public async Task ConvertFile()
{
var client = InitClient();
int firstPage = 1;
int lastPage = -1;
// set the Target format to PDF
int fileFormat = 4;
//If uploading a file as multi-part content:
HttpContent byteContent = new ByteArrayContent(File.ReadAllBytes(@"path/to/file"));
byteContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
var result = await client.PostAsync(conversionUrl, null); */
if (result.StatusCode == HttpStatusCode.OK)
{
//Unique ID returned by the services
string id = await result.Content.ReadAsStringAsync();
Console.WriteLine("Unique ID returned by the services: " + id);
await Query(id, client);
}
else
Console.WriteLine("Request failed with the following response: " + result.StatusCode);
}
You can find more details with full sample code here: https://services.leadtools.com/documentation/api-reference/convert https://services.leadtools.com/documentation/tutorials/net-cs-conversion-tutorial
It doesn't looks straight forward i.e. you may need HTML in between. If format is ".docx", OpenXML can be used in .NET framework, not in .NET Core though. Please read this https://stackoverflow.com/questions/46580718/convert-word-doc-and-docx-format-to-pdf-in-net-core-without-microsoft-office-in
Raheel AhmadPosted Nov 27, 2018, 1:05 AM
FOOTER TEXT
";Maen BadwanPosted Sep 13, 2018, 7:47 AM
https://services.leadtools.com/documentation/api-reference/convert
https://services.leadtools.com/documentation/tutorials/net-cs-conversion-tutorial
Leon DPosted Sep 2, 2018, 9:14 PM
Sanwar RanwaPosted Sep 2, 2018, 11:37 AM
Jignesh KumarPosted Aug 31, 2018, 10:26 PM
Jaish MathewsPosted Aug 31, 2018, 7:49 AM