Convert Excel to Pdf, Image and other formats

Convert Excel Workbook to PDF

PDF files are widely used to exchange documents between organizations, government sectors, and individuals. It is a standard document format and software developers are often asked to find a way to convert Microsoft Excel files into PDF documents.

Aspose.Cells for Python via .NET supports converting Excel files to PDF and maintains high visual fidelity in the conversion.

Convert Excel Workbook to JPG

Aspose.Cells for Python via .NET supports converting Excel files to JPG. The code example below shows how to save a workbook as JPG.

Convert Excel Workbook to Image

Aspose.Cells for Python via .NET supports converting Excel files to images. The code example below shows how to save a workbook as images.

Converting Excel Workbook to XPS

The XPS document format consists of structured XML markup that defines the layout of a document and the visual appearance of each page, along with rendering rules for distributing, archiving, rendering, processing, and printing documents.

The markup language for XPS is a subset of XAML which allows it to incorporate vector graphics elements in documents, using XAML to mark up the Windows Presentation Foundation (WPF) primitives. The elements used are described in terms of paths and other geometrical primitives.

An XPS file is, in fact, a unicode ZIP archive using the Open Packaging Conventions, containing the files which make up the document. These include an XML markup file for each page, text, embedded fonts, raster images, 2D vector graphics, as well as the digital rights management information. The contents of an XPS file can be examined simply by opening it in an application that supports ZIP files.

Convert Excel to Ods,Sxc and Fods (OpenOffice / LibreOffice Calc)

Aspose.Cells for Python via .NET supports converting Excel files to Ods,Sxc and Fods files . The code example below shows how to convert the tempalte to Ods,Sxc and Fods file.

Converting Excel Workbook to MHTML Files

MHTML combines normal HTML with external resources (that is, content that is usually linked in, like images, animations, audio, and so on) into one file. They are used for emails with the .mht file extension.

Aspose.Cells for Python via .NET supports reading and writing MHTML files.

The code example below shows how to save a workbook as an MHTML file.

Converting Excel Workbook to HTML

The Aspose.Cells for Python via .NET API provides support for exporting spreadsheets to HTML format. For this purpose, Aspose.Cells for Python via .NET uses the HtmlSaveOptions class to provide the flexibility to control several aspects of the output HTML.

The code example below shows how to save a workbook as an HTML file.

Setting the Image Preferences for HTML

Aspose.Cells for Python via .NET has exposed image_options for the HtmlSaveOptions class, allowing developers to specify image preferences when saving spreadsheets to HTML format.

Below are details of some of the image settings that can be applied,

  • ImageType: Specifies the image type. Please note, all shapes, including charts, render as images in the output HTML.
  • smoothing_mode: Specifies the anti-aliasing for lines, curves & edges of filled areas.
  • text_rendering_hint: Specifies the quality of text rendering.
  • quality: Specifies the quality of the image between 0 to 100, when ImageType is specified as Jpeg.
  • vertical_resolution: Gets or sets the vertical resolution of the image in dots per inch.
  • horizontal_resolution: Gets or sets the horizontal resolution of the image in dots per inch.
  • tiff_compression: Gets or sets the compression type for the images when ImageType is specified as Tiff.
  • transparent: Indicates if the background of an image should be transparent when ImageFormat is specified as Png.

The code below demonstrates how to use HtmlSaveOptions.image_options to specify different preferences.

Convert Excel Workbook to Markdown

The Aspose.Cells for Python via .NET API provides support for exporting spreadsheets to Markdown format. To export the active worksheet to Markdown, pass SaveFormat.Markdown as the second parameter of Workbook.Save method. You may also use MarkdownSaveOptions class to specify additional settings for exporting worksheet to Markdown.

The following code example demonstrates exporting active worksheet to Markdown by using SaveFormat.MARKDOWN enumeration member. Please see the output Markdown file generated by the code for reference.

Convert Excel Workbook to JSON

Aspose.Cells for Python via .NET supports converting a workbook to Json(JavaScript Object Notation) file.

The following code example demonstrates exporting active worksheet to Json by using SaveFormat.JSON enumeration member. Please see the code to convert source file to the output Json file generated by the code for reference.

Convert Excel to XML

Aspose.Cells for Python via .NET supports converting a workbook to Excel 2003 Spreadsheet XML and plain XML data.

Convert Excel Workbook to TIFF

Aspose.Cells for Python via .NET supports converting a workbook to TIFF file.

The code snippet below shows how to convert Excel to TIFF:

Convert Excel Workbook to DOCX

The Aspose.Cells for Python via .NET API provides support for converting spreadsheets to DOCX format. To export the workbook to DOCX, pass SaveFormat.DOCX as the second parameter of Workbook.save method. You may also use DocxSaveOptions class to specify additional settings for exporting worksheet to DOCX.

The following code example demonstrates exporting active worksheet to DOCX by using SaveFormat.DOCX enumeration member. Please see the output DOCX file generated by the code for reference.

Convert Excel Workbook to PPTX

The Aspose.Cells for Python via .NET API provides support for converting spreadsheets to PPTX format. To export the workbook to PPTX, pass SaveFormat.PPTX as the second parameter of Workbook.save method. You may also use PptxSaveOptions class to specify additional settings for exporting worksheet to PPTX.

The following code example demonstrates exporting active worksheet to PPTX by using SaveFormat.PPTX enumeration member. Please see the output PPTX file generated by the code for reference.

Advance topics