Create Excel file and save as PDF

0 votes
I want to open an Xlsx file, add data from the back end, and then save it as a PDF on the client. At a time, the procedure would produce roughly 100 files. I discovered after doing some online research that Excel Interop is no longer usable. Does XML SDK have to be used?

I am unable to use any products or APIs from third parties. It is either using XML or Interop, but it is only asking for coding recommendations. I do have a professional license for Adobe, and I've used Office Automation to save Excel files as PDFs.

What are my options? Any recommendation would be greatly appreciated.
Oct 10, 2022 in Others by Kithuzzz
• 38,000 points
1,424 views

1 answer to this question.

0 votes

Office 2013 still has the Interop library and it works perfectly fine under .NET 4.5.1 Just add Microsoft.Office.Interop.Excel assembly to your references and you are ready to go.

using System;
using Microsoft.Office.Interop.Excel;

namespace officeInterop
{
    class Program
    {
        static void Main(string[] args)
        {
            Application app = new Application();
            Workbook wkb = app.Workbooks.Open("d:\\x.xlsx");
            wkb.ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, "d:\\x.pdf");
        }
    }
}
answered Oct 11, 2022 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

How can I convert excel to PDF by Libreoffice and keep all format from excel file?

"Times New Roman" typeface does not have ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,676 views
0 votes
1 answer

Uipath(RPA) : read data from the PDF file and write to Excel file

If you want to use UiPath and ...READ MORE

answered Oct 17, 2022 in Others by narikkadan
• 63,600 points
2,181 views
0 votes
1 answer

Spire When Pdf-ing an excel file it leaves some formulas as System.Object[][]

Since you tested the Excel file and ...READ MORE

answered Nov 25, 2022 in Others by narikkadan
• 63,600 points
1,008 views
0 votes
1 answer

How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?

You can use OLEDB to create and ...READ MORE

answered Jan 3, 2023 in Others by narikkadan
• 63,600 points
1,620 views
0 votes
1 answer

How to convert PDF to Excel in C#?

Solutions a) xodo makes a free online conversion from PDF ...READ MORE

answered Oct 1, 2022 in Others by narikkadan
• 63,600 points
1,031 views
0 votes
1 answer

Merge and export Excel/Word/PDF to PDF

Use GroupDocs.Merger for .NET API to merge Word, Excel, ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,513 views
0 votes
1 answer

Excel to PDF C# library

These articles will be help for you ...READ MORE

answered Oct 21, 2022 in Others by narikkadan
• 63,600 points
898 views
0 votes
1 answer

Converting PDF to Excel using Adobe PDF Tool API in .NET

An identical mistake was occurring for me ...READ MORE

answered Dec 15, 2022 in Others by narikkadan
• 63,600 points
1,091 views
0 votes
1 answer

Using excel I need to open PPT and create ".gif" image of a ."pdf" and save it

It appears happier if you get a ...READ MORE

answered Dec 24, 2022 in Others by narikkadan
• 63,600 points
491 views
0 votes
1 answer

Java Spring - Writing Excel file and converting to PDF

Since you are using Spring I suggest ...READ MORE

answered Sep 26, 2022 in Others by narikkadan
• 63,600 points
2,654 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP