Amin Dodin177 reputationPosted Oct 17, 2019, 12:47 AM EDT
+1
You could
use the DocumentConverter class from LEADTOOLS (https://www.leadtools.com/sdk/document/document-converter).
It can convert among different files, including Excel to PDF.
You should
first retrieve the Excel sheet from the database and place it in a stream. You
can then use the following code to convert it:
privatevoid DocConvStream(Stream xlsStream)
{
var options = new LoadDocumentOptions();
xlsStream.Position = 0;
using (var document = DocumentFactory.LoadFromStream(xlsStream, options))
{
using (DocumentConverter documentConverter = new DocumentConverter())
{
var outFile = @"outFile.pdf";
var format = Leadtools.Document.Writer.DocumentFormat.Pdf;
var jobData = DocumentConverterJobs.CreateJobData(document, outFile, format);
jobData.JobName = "conversion job";
var job = documentConverter.Jobs.CreateJob(jobData);
documentConverter.Jobs.RunJob(job);
}
}
}
If you would
like to try it, there’s a free evaluation edition here:
Salman BegRank #284 · 8.8K reputationPosted Oct 14, 2019, 6:37 AM EDT
Leon DRank #851 · 2.6K reputationPosted Oct 14, 2019, 4:22 PM EDT
Amin Dodin177 reputationPosted Oct 17, 2019, 12:47 AM EDT
You could use the DocumentConverter class from LEADTOOLS (https://www.leadtools.com/sdk/document/document-converter). It can convert among different files, including Excel to PDF.
You should first retrieve the Excel sheet from the database and place it in a stream. You can then use the following code to convert it:
Somit Vishwakarma59 reputationPosted Oct 18, 2019, 2:21 AM EDT
Chittaranjan SwainRank #216 · 11.3K reputationPosted Oct 18, 2019, 11:19 PM EDT
Dipa MehtaRank #361 · 6.9K reputationPosted Oct 23, 2019, 4:45 AM EDT
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 13, 2019, 3:02 PM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts