Excel to pdf library

Nuget Nuget
Passed
windows
macOS
linux
docker
aws
microsoftazure

.NET SDK to convert Excel (xls, xlsx) to PDF

Excel

SautinSoft.Excel is .NET assembly (SDK) to convert Excel (.xls and .xlsx) workbooks to PDF, RTF, DOCX, Word.

Quick links

  • Developer Guide
  • API Reference

Top Features

  • Convert Excel file to PDF file.
  • Convert Excel file to DOCX file.
  • Split/Merge PDF files.

System Requirement

  • .NET Framework 4.6.1 — 4.8.1
  • .NET Core 2.0 — 3.1, .NET 5, 6, 7
  • .NET Standard 2.0
  • Windows, Linux, macOS, Android, iOS.

Getting Started with Excel to PDF .Net

Are you ready to give Excel to PDF .NET a try? Simply execute Install-Package sautinsoft.exceltopdf from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Excel to PDF .NET and want to upgrade the version, please execute Update-Package sautinsoft.exceltopdf to get the latest version.

Convert XLS to PDF

ExcelToPdf x = new ExcelToPdf();
// Set PDF as output format.
x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf;
string excelFile = Path.GetFullPath(@"....test.xls");
string pdfFile = Path.ChangeExtension(excelFile, ".pdf"); 
x.ConvertFile(excelFile, pdfFile);

Convert XLS to DOCX

ExcelToPdf x = new ExcelToPdf();
// Set DOCX as output format.
x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx;
string excelFile = Path.GetFullPath(@"....test.xls");
string docxFile = Path.ChangeExtension(excelFile, ".docx"); 
x.ConvertFile(excelFile, docxFile);

Merge PDF

ExcelToPdf x = new ExcelToPdf();
FileInfo pdfFile = new FileInfo(Path.ChangeExtension(excelFile, ".pdf"));
string singlePdf = Path.Combine(pdfFile.Directory.FullName, "Single.pdf");
x.MergePDFFileArrayToPDFFile(new string[] { pdfFile.FullName, pdfFile.FullName }, singlePdf);

Resources

  • Website: www.sautinsoft.com
  • Product Home: Excel to PDF .Net
  • Download SautinSoft.ExcelToPdf
  • Developer Guide
  • API Reference
  • Support Team
  • License

This package provides the functionality to utilize the features of Syncfusion WPF Excel-To-PDF Converter and more.

Score: 4.5


| 2/2/2021 | v21.1.39

Syncfusion ExcelToPdfConverter is a .NET library that is used to convert Excel documents into PDF in any ASP.NET Web Forms application without Microsoft Office dependencies.

Key features:
• Convert entire Excel workbook into PDF.
• Convert specific Excel worksheet into PDF.
• Convert Excel docu…

Score: 4.5


| 2/2/2021 | v21.1.39

This package provides the functionality to utilize the features of Syncfusion Excel-To-PDF Converter .NET Client Profile and more.

Score: 4.4


| 2/2/2021 | v21.1.39

Entity Framework Extensions

This package provides the functionality to utilize the features of Syncfusion WinForms Excel to Pdf conversion Library.

Score: 4.4


| 2/2/2021 | v21.1.39

Syncfusion Excel-to-PDF converter is a .NET library that is used to convert Excel documents into PDF in any ASP.NET MVC application without Microsoft Office dependencies.

Score: 4.4


| 2/2/2021 | v21.1.39

Syncfusion Excel-to-PDF converter is a .NET library that is used to convert Excel documents into PDF in any ASP.NET MVC application without Microsoft Office dependencies.

Score: 4.4


| 2/2/2021 | v21.1.39

EVO Excel to PDF Converter can be used in any type of .NET application to convert Excel XLS and XLSX documents to PDF documents. The Excel to PDF Converter does not use Microsoft Office or other third party tools. The Excel document to convert can be in a memory buffer or in a file and the resulted …

Score: 1


| 11/5/2019 | v9.0.1

Winnovative Excel to PDF Converter can be used in any type of .NET Core application to convert Excel documents to PDF. The integration with existing .NET Core applications is extremely easy and no installation is necessary in order to run the converter. The downloaded archive contains the assembly f…

Score: .8


| 11/5/2019 | v9.0.1

EVO Excel to PDF Converter can be used in any type of .NET Core application to convert Excel XLS and XLSX documents to PDF documents. The Excel to PDF Converter does not use Microsoft Office or other third party tools. The Excel document to convert can be in a memory buffer or in a file and the resu…

Score: .8


| 11/5/2019 | v9.0.1

Score: .5


| 8/22/2017 | v

Score: .5


| 9/16/2017 | v

Winnovative Excel to PDF Converter can be used in any type of .NET application to convert Excel documents to PDF. The integration with existing .NET applications is extremely easy and no installation is necessary in order to run the converter. The downloaded archive contains the assembly for .NET an…

Score: .5


| 11/5/2019 | v9.0.1

I’ve tried to move away from direct COM interaction via Interop through third-party packages, but when that’s not an option due to cost considerations, I’ll use Office 2007/2010’s built-in export functionality to accomplish this.

The method you need to call is Workbook.ExportAsFixedFormat()

Here is an example of how I use it an an export function:

public bool ExportWorkbookToPdf(string workbookPath, string outputPath)
{
    // If either required string is null or empty, stop and bail out
    if (string.IsNullOrEmpty(workbookPath) || string.IsNullOrEmpty(outputPath))
    {
        return false;
    }

    // Create COM Objects
    Microsoft.Office.Interop.Excel.Application excelApplication;
    Microsoft.Office.Interop.Excel.Workbook excelWorkbook;

    // Create new instance of Excel
    excelApplication = new Microsoft.Office.Interop.Excel.Application();

    // Make the process invisible to the user
    excelApplication.ScreenUpdating = false;

    // Make the process silent
    excelApplication.DisplayAlerts = false;

    // Open the workbook that you wish to export to PDF
    excelWorkbook = excelApplication.Workbooks.Open(workbookPath);

    // If the workbook failed to open, stop, clean up, and bail out
    if (excelWorkbook == null)
    {
        excelApplication.Quit();

        excelApplication = null;
        excelWorkbook = null;

        return false;
    }

    var exportSuccessful = true;
    try
    {
        // Call Excel's native export function (valid in Office 2007 and Office 2010, AFAIK)
        excelWorkbook.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF, outputPath);
    }
    catch (System.Exception ex)
    {
        // Mark the export as failed for the return value...
        exportSuccessful = false;

        // Do something with any exceptions here, if you wish...
        // MessageBox.Show...        
    }
    finally
    {
        // Close the workbook, quit the Excel, and clean up regardless of the results...
        excelWorkbook.Close();
        excelApplication.Quit();

        excelApplication = null;
        excelWorkbook = null;
    }

    // You can use the following method to automatically open the PDF after export if you wish
    // Make sure that the file actually exists first...
    if (System.IO.File.Exists(outputPath))
    {
        System.Diagnostics.Process.Start(outputPath);
    }

    return exportSuccessful;
}

  • Продукты
  • Поддержка & Обучение
  • Простой API для полного контроля над документом!

  • Конвертер PDF во всё.

  • Конвертер HTML, Text, RTF и DOCX документы в PDF формат.

  • Конвертер HTML, URL и картинки в PDF формат.

  • Конвертер HTML в RTF, Word и Text документы.

  • Конвертер Text, DOCX, RTF документы в HTML/XHTML документы с CSS.

  • Конвертер Excel листы и книги в PDF, Word, RTF.

  • Конвертер между DOC, DOCX, RTF, XLS, XLSX, HTML, PPT, CV, Text и PDF, документы с таблицами, картинки, шрифты, цвета и т.п.

  • Есть вопрос или проблема? Узнайте, как мы можем Вам помочь.

  • Лицензирование
  • Планы поддержки
  • Форма обратной связи
  • Контакты
  • Читайте, смотрите и узнавайте о наших продуктах, команде и последних тенденциях.

  • Видео
  • База знаний
  • Online Demos
  • Узнайте, что нового в последних версиях наших продуктов.

  • SautinSoft.Document
  • SautinSoft.PdfFocus
  • SautinSoft.PdfMetamorphosis
  • SautinSoft.ExcelToPdf
  • SautinSoft.PdfVision
  • SautinSoft.HtmlToRtf
  • SautinSoft.RtfToHtml
  • SautinSoft.UseOffice

Обзор

«SautinSoft.ExcelToPdf» на 100% написан на C# (.NET Framework и .NET Core), который предоставляет широкий набор API для разработчиков. Это дает вашему приложению возможность экспортировать любой *.xls и *.xlsx (рабочая тетрадь Excel 97 — 2019) в форматах PDF, Word, RTF и DOCX. Смотрите подробности:

  • Конвертировать Excel в PDF
  • Конвертировать Excel в DOCX
  • Конвертировать Excel в RTF

Поддерживает ковертирование *.xls и *.xlsx to PDF, Word, RTF, DOCX:

  • Полное форматирование шрифта и текста: цвета, начертание, размер, жирный шрифт, курсив, подчеркивание, зачеркивание, надстрочный индекс, подстрочный индекс.
  • Экспорт электронных таблиц с сохранением границ, фона.
  • Гиперссылки и якоря.
  • Специальные символы.
  • Несколько листов в одном документе.
  • Различные типы ячеек: строки, числа, даты, плавающая точка.
  • Объединенные ячейки, ширина и высота строки и ячейки.
  • Формулы.
  • Файлы XLSX и XLS защищены паролем.
  • Экспортируйте книги Excel в память.

Почему выбрать SautinSoft.ExcelToPdf?

Быстрый и эффективный

Экономьте память и время благодаря облегченной архитектуре API. Чем больше документ, тем быстрее наш API генерирует сложные документы Word.

Конвертируйте Excel в документы PDF и Word

Предоставляет API для ваших приложений для преобразования документов Excel в документы PDF и Word (DOCX, RTF).

Автономный и независимый

SautinSoft.ExcelToPdf является абсолютно автономной сборкой .NET и не имеет никаких зависимостей от Microsoft Office или Adobe Acrobat.

Полная поддержка .NET для Windows, Linux и Mac

Разрабатывайте для любой платформы .NET или основных операционных систем с единой кодовой базой. Используйте в своих приложениях .NET Framework, Mono, Xamarin.iOS и Xamarin.Android.

Полезные настройки преобразования

Благодаря множеству полезных настроек и опций вы можете настроить результат преобразования по своему усмотрению: установить размер страницы, ориентацию и поля, одну начертание шрифта, добавить пользовательские верхние и нижние колонтитулы, добавить нумерацию страниц, уместить лист на одной странице и многое другое.

Развертывание приложений с документами Word в облаке

Будьте везде благодаря облачному развертыванию. С помощью NuGet и Documents for Word вы можете выполнять развертывание в Azure, AWS и AWS Lambda.

Вы можете настроить полученный PDF-файл, используя свойства:

  • Укажите, чтобы преобразовать всю книгу Excel или пользовательские электронные таблицы или пользовательские ячейки в определенном диапазоне.
  • Укажите свойства страницы для создаваемого документа: размер страницы, ориентацию и поля.
  • Добавьте номера страниц с желаемым форматированием.
  • Укажите пароль для защищенных книг.
Типичные приложения для использования нашего SDK:

  • Преобразование электронных таблиц Excel и рабочих книг из базы данных в PDF с намеренным отображением их в ASP.NET страница.
  • Создайте печатную копию файла XLS в формате PDF для обмена и запретите изменять.
  • Экспортируйте XLS в Word для печати.

Пример преобразования электронной таблицы из документа Excel в PDF в приложении C#:

ExcelToPdf x = new ExcelToPdf();
x.PageStyle.PageSize.Letter();

// Set PDF as output format.
x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Pdf;

// Let's convert only 1st sheet.
x.Sheets.Custom(new int[] { 1 });

string excelFile = @"d:myWorkBook.xlsx";
string pdfFile = Path.ChangeExtension(excelFile, ".pdf"); ;

try
{
    x.ConvertFile(excelFile, pdfFile);
    System.Diagnostics.Process.Start(pdfFile);
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
    Console.ReadLine();
}

Основные функции

Конвертировать файл Excel в PDF-файл

Предоставляет API для преобразования книг и листов Excel в формат PDF. Поддерживает .xls и .форматы xlsx. Позволяет указать желаемый диапазон ячеек для преобразования, настройки страницы, полей и других пользовательских свойств.


Подробнее

Расширенные возможности

SautinSoft.ExcelToPdf code-examples

На самом деле компонент может конвертировать в PDF с множеством опций, таких как: Добавление верхнего и нижнего колонтитулов, указание нумерации страниц, Добавление пользовательских водяных знаков, Установка размера страницы, полей и ориентации и многое другое. Смотрите Руководство разработчика, чтобы ознакомиться с простыми, продвинутыми и сложными примерами, оно содержит более 50 примеров.


Руководство разработчика

Требования и техническая информация

SautinSoft.ExcelToPdf совместим со всеми .NET языки и поддерживает все ОС (Windows, macOS и Linux), где может использоваться .NET Framework или .NET Core.
Он полностью написан на управляемом C#, что делает его абсолютно автономным и независимым.

.Net Framework 4.0 and higher and .Net Core 2.0 and higher

.NET Framework 4.6.1, 4.7, 4.7.2, 4.8

.NET Core 2.0, 2.1, 2.2, 3.0, 3.1

.NET 5, 6, 7



Нам доверяют ведущие мировые компании

Содержание

  1. Convert Excel XLS and XLSX to PDF in C#
  2. C# API for Excel to PDF Conversion#
  3. How to Convert an Excel File to PDF in C#
  4. Convert Excel XLS or XLSX to PDF in C#
  5. C# Excel to PDF/A Compliant PDF Conversion#
  6. C# Excel XLS XLSX to PDF — Track Conversion
  7. C# Excel to PDF Converter — Get a Free License#
  8. Conclusion#
  9. Сохранение документов Excel в PDF на сервере
  10. How to Convert Excel XLSX Spreadsheets to PDF in C# and .NET 6
  11. Exporting Excel Spreadsheets to PDF in .NET
  12. Step 1: Create an Excel Spreadsheet
  13. Step 2: Convert Excel Spreadsheets to PDF
  14. Step 3: Load Excel spreadsheet and save to PDF
  15. SautinSoft/Excel-to-PDF-Net
  16. Sign In Required
  17. Launching GitHub Desktop
  18. Launching GitHub Desktop
  19. Launching Xcode
  20. Launching Visual Studio Code
  21. Latest commit
  22. Git stats
  23. Files
  24. README.md
  25. About
  26. Convert Excel to PDF Using Python
  27. What is win32com?

Convert Excel XLS and XLSX to PDF in C#

Excel files are widely used to keep and share the tabular data. On the other hand, PDF format has been among the ruling digital document formats. In certain cases, the Excel files are to be converted into PDF format programmatically. To achieve that, this article demonstrates how to convert Excel XLS XLSX to PDF in C#.

C# API for Excel to PDF Conversion#

Aspose.Cells for .NET API makes converting Excel spreadsheets to PDF a breeze. You can either download the API’s DLL or install it using NuGet.

How to Convert an Excel File to PDF in C#

Using Aspose.Cells for .NET, you can easily convert an Excel file to PDF within a couple of steps. This is how you can save an Excel file as using the API.

  • Load the Excel file from the disk.
  • Save it as PDF to desired location.

And that’s it. Now, let’s have a look at how to perform Excel to PDF conversion via C# code.

Convert Excel XLS or XLSX to PDF in C#

Aspose.Cells for .NET provides easy to use API with which you can convert Excel files to PDF with these simple steps.

  1. Instantiate the Workbook class with the Excel document that you want to convert.
  2. Save the document in PDF format by specifying the save format as PDF by using the SaveFormat Enumeration

The following code snippet demonstrates how to convert Excel XLS to PDF in C#.

C# Excel to PDF/A Compliant PDF Conversion#

PDF/A is an ISO-standardized version of PDF that prohibits features that are not suitable for long term archiving. Saving PDF like this ensures that nothing will break in the long run.

The following code snippet demonstrates how to convert an Excel workbook to a PDF/A compliant PDF format in C#.

C# Excel XLS XLSX to PDF — Track Conversion

Aspose.Cells for .NET provides the ability to track the conversion progress by providing the IPageSavingCallback interface. You can create a custom class that implements this interface and assign its instance to PdfSaveOptions.PageSavingCallback property.

The following code snippet demonstrates how to track the Excel to PDF conversion progress using C#.

The following is the custom class that implements the IPageSavingCallback interface for tracking the conversion process.

C# Excel to PDF Converter — Get a Free License#

You can use Aspose.Cells for .NET without evaluation limitations using a temporary license.

Conclusion#

In this article, you have learned how to convert Excel XLSX or XLS files to PDF in C#. For more information on converting Excel files to PDF, head on over to our documentation, Convert Excel Workbook to PDF. In case you would have any queries, feel free to let us know via our forum.

Источник

Сохранение документов Excel в PDF на сервере

Не так давно появилась задача создать простой сервис по созданию PDF отчетов на основе офисных документов для интранета. И вроде бы все просто, но вот с сохранением Excel в PDF возникли проблемы. Интересно? Прошу под кат.

Как я и сказал, поначалу все казалось легко, у меня были собственные наработки, на хабре была статья. Но обо всем по порядку.

Мои наработки использовали сom объекты excel.application и метод saveAs, это прекрасно работало, пока требовалось взять обычный, красивый документ и сделать из него pdf, но в данном случае файлы были нет так просты.

Во-первых, документы предполагаются трех форматов — xls, xlsx и xml. Во вторых все документы содержат макросы, а некоторые ссылки на другие документы. В третьих они содержат кучу листов, и перекрестные ссылки между листами. Не нужные для отчета листы делаются скрытыми, а на самих листах в каше вспомогательных цифр отчетная информация выделялась областью печати. Нужно ли говорить, что saveAs игнорирует все это богатство и на выходе после танца с бубнами получаем абсолютно не читаемую картину.

Здесь я думаю необходимо сделать лирическое отступление и пояснить, почему с файлами творится такая неразбериха. Я работаю в очень крупной организации, бок обок с кучей бабушке пенсионного возраста. Они не могут даже сделать текст в ячейке жирным, но прекрасно могут говорить начальству о том, что они не «программисты» и не должны это уметь. Начальства у нас тоже много, и в силу жалости к бабушкам или своей компьютерной безграмотности, а быть может, по велению звезд жалобы бабушек поощряются, и все попытки разгрести бардак в документах пресекается.

Вернемся к нашим баранам. В выше упомянутой статье был предложен вариант конвертации «Как вижу» с использованием open office, этот вариант меня не устроил в силу ветреного отношения OO к MS. Некоторые документы действительно открывались в нем корректно, но чаще всего содержимое ехало еще до конвертации.

Был еще третий вариант. Печатать документы на виртуальный принтер, но я решил, что этот вариант я приберегу на самый крайний случай, так это костыль.

И тогда я обратился к гуглу и он дал мне эту замечательную ссылку. Описанный в ней метод ExportAsFixedFormat был тем, что нужно! Но меня опять постигла не удача.

Он начисто игнорировал области печати, а без них получалась каша. Я гуглил, оставлял вопросы на множестве форумах, в том числе и на англоязычных. Ответа не было. Я даже перенес код статьи в C#, но результат не изменился.

После недели изысканий, я решил плюнуть на все и использовать тот самый крайний вариант с виртуальным принтером, но каково же было мое изумление, когда и он проигнорировал область печати, притом, что если отправить документ из самого Excel все было нормально.

Путем проб и ошибок, танцев с бубнами и увлекательным чтением гугла я выяснил, области печати игнорируется при вызове этого метода и печати в php, C#, но почему то при использовании VBScript все работает как надо. Чем это вызвано я, к сожалению, так и не выяснил.

И так, было решено из PHP открывать VBS скрип и уже из него преобразовывать excel в pdf. Да, это тоже костыль, но не такой неуклюжий как виртуальный принтер.

Вот получившийся скрипт:

Dim XL
Dim XLWkbk
Dim ObjArgs
Dim paramSourceBookPath
Dim paramExportFilePath

set objargs = wscript.arguments
if objArgs.count exec(APPLICATION_SCRIPT_FOLDER.’\excel.vbs C:\tmp\test.xlsx C:\tmp\test.pdf»);

В сухом остатке мы имеем не совсем красивый, но 100% рабочий метод по преобразованию Excel в PDF, который гарантирует результат «Как на печати» без подводных камней.

Источник

How to Convert Excel XLSX Spreadsheets to PDF in C# and .NET 6

If you have Excel spreadsheets generated from .NET Core applications, you may find it helpful to store your files in a PDF format.

Why do I need to convert an Excel spreadsheet to PDF?

Several reasons include:

  • Storing Excel spreadsheets for long-term preservation.
  • Not having MS Office installed on a system, but still wanting to open, print, or distribute your Excel spreadsheets.
  • Consistency of presentation of Excel spreadsheets when opened on different systems.

Alternatively, you may need to create and distribute the following company reports:

  • Profit & Loss Statement
  • Company Budget
  • Sales Forecast
  • Income Statement

GrapeCity Documents for Excel (GcExcel) is a high-speed, small-footprint spreadsheet API that requires no dependencies on Excel. With full .NET Core support, you can generate, load, modify, and convert spreadsheets in .NET Framework, .NET Core, Mono, and Xamarin. Apps using this spreadsheet API can be deployed to the cloud, Windows, Mac, or Linux.

Exporting Excel Spreadsheets to PDF in .NET

This demo will cover the following:

  • How to create an Excel Spreadsheet and save it to PDF
  • How to load an Excel Spreadsheet and save it to PDF

Note: When working with GcExcel on MAC or Linux, specify the Workbook.FontFolderPath and place the necessary fonts in it before exporting spreadsheets to PDF.

Step 1: Create an Excel Spreadsheet

Follow this link to create a basic Excel spreadsheet on Windows, MAC, or Linux.

At the end of this tutorial, the spreadsheet will look like this:

Step 2: Convert Excel Spreadsheets to PDF

In Step 1, we created an Excel spreadsheet using the GcExcel workbook and saved it to an Excel file. Instead of saving to Excel, you can directly save the workbook to PDF. Please note if you need to print the worksheet on a single PDF, you can set additional options through the PageSetup class of the worksheet.

The PDF will look like this:

Step 3: Load Excel spreadsheet and save to PDF

If you want to convert any of your Excel files (whether created with Excel, GcExcel, or from another third-party tool), you can do so in just three steps using GcExcel.

Suppose you want to convert an Excel file that calculates the total account data summary (per different age groups in a region) to a PDF.

Follow these steps:

1. Create an empty workbook

2. Load Excel file into the workbook

3. Save To PDF

You have easily converted your excel spreadsheet to PDF:

Supported PDF export features include:

Visit this help topic for more info on how to convert Excel to PDF in Java.

Please leave a comment below if this feature satisfies your requirement or you are looking for some additional features!

Источник

SautinSoft/Excel-to-PDF-Net

Use Git or checkout with SVN using the web URL.

Work fast with our official CLI. Learn more.

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Excel to PDF .Net by SautinSoft is 100% written in C# (.NET Framework and .NET Core) assembly which provides a wide set of API for developers. It gives your application the abilities of exporting any *.xls and *.xlsx (Excel 97 — 2019 workbook) to PDF, Word, RTF and DOCX formats. See details:

Convert Excel to PDF.

Convert Excel to DOCX.

Convert Excel to RTF.

Split and merge PDF documents.

It supports the conversion of *.xls and *.xlsx to PDF, Word, RTF, DOCX with:

Full font and text formatting: colors, face, size, bold, italic, underline, strike, superscript, subscript.

Export of spreadsheets with preserving borders, background.

Hyperlinks and anchors.

Multiple worksheets in a single document.

Various cell types: strings, numbers, dates, floating point.

Merged cells, row and cell width and height.

XLSX and XLS files protected by a password.

Export Excel workbooks in memory.

This repository contains Examples for Excel to PDF .Net to help you learn and write your own applications.

Directory Description
Examples for Excel to PDF .Net A collection of C#, VB.NET, php examples that help you learn and explore the API features
  • Website:www.sautinsoft.com
  • Product Home:Excel to PDF .Net
  • Download:Download Excel to PDF .Net
  • Documentation:Excel to PDF .Net Documentation API
  • Support:You are always welcome at SautinSoft company with your feedback and questions, it helps us to work more effective!

About

Excel to PDF .Net is a standalone C# library to convert Excel spreadsheets and workbooks to PDF, Word, RTF.

Источник

Convert Excel to PDF Using Python

Python is a high-level, general-purpose, and very popular programming language. Python programming language (latest Python 3) is being used in web development, Machine Learning applications, along with all cutting-edge technology in Software Industry.

In this article, we will learn how to convert an Excel File to PDF File Using Python

Here we will use the win32com module for file conversion.

What is win32com?

Python extensions for Microsoft Windows Provide access to much of the Win32 API, the ability to create and use COM objects, and the Pythonwin environment.

Approach:

  • First, we will create a COM Object Using Dispatch() method.
  • Then we will read the Excel file pass “Excel.Application” inside the Dispatch method
  • Pass Excel file path
  • Then we will convert it into PDF using the ExportAsFixedFormat() method

ExportAsFixedFormat():- The ExportAsFixedFormat method is used to publish a workbook in either PDF or XPS format.

ExportAsFixedFormat (Type, FileName, Quality, IncludeDocProperties, IgnorePrintAreas, From, To,

Input:

EXCEL FILE

Below is the Implementation:

Источник

Понравилась статья? Поделить с друзьями:
  • Excel to pdf converter offline
  • Excel to pdf apk
  • Excel to pdf adobe pro
  • Excel to outlook export
  • Excel to oracle toad