Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
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 graphic 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 Unicoded 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.
From Aspose.Cells 6.0.0, Microsoft Excel tp XPS conversion is supported.
The following example shows how to convert a single worksheet in an Excel file to XPS.
The following example shows how to convert the whole workbook to XPS format.
The following example shows a simple way to directly convert the Excel file to XPS format.
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.
Converting a spreadsheet to MHTML is a quick operation, as shown below.
The code example below shows how to save a workbook as an MHTML file.
The Aspose.Cells APIs provides support for exporting spreadsheets to HTML format. For this purpose, Aspose.Cells uses the HtmlSaveOptions class which allows developers to control several aspects of the output HTML.
The code below demonstrates how to use the HtmlSaveOptions class to export Microsoft Excel files to HTML format without specifying additional parameters.
Starting from 8.0.2, Aspose.Cells has exposed ImageOptions for the HtmlSaveOptions class, which allows developers to specify image preferences when saving spreadsheets to HTML format.
The image settings that can be applied are:
The code below demonstrates how to use HtmlSaveOptions.ImageOptions to specify different preferences.
| Spreadsheet view before export | HTML view after export |
|---|---|
![]() |
![]() |
PDF documents are widely used as a standard format of exchanging documents between organizations, government sectors, and individuals. Software developers are often asked to device a way to easily convert Microsoft Excel files into PDF documents. Aspose.Cells supports these features. This article shows how.
Microsoft Excel to PDF conversion was introduced with Aspose.Cells for Java 2.3.0. From that release, Aspose.Cells can convert spreadsheets to PDF directly (including PDF/A), without another product. To convert spreadsheets with older versions of Aspose.Cells, use Aspose.PDF for the conversion.
Aspose.Cell’s converts spreadsheets to PDF with a high degree of accuracy and fidelity. However, there are a few limitations, listed at the end of this article.
Aspose.Cells for Java directly writes the information about API and Version Number in output documents. For example, upon rendering Document to PDF, Aspose.Cells for Java populates Application field with value ‘Aspose.Cells’ and PDF Producer field with a value, e.g ‘Aspose.Cells for Java v17.9’.
Please note that you cannot instruct Aspose.Cells for Java to change or remove this information from output Documents.
Save an Excel file directly to PDF using the Workbook.save method, and provide the SaveFormat.PDF interface member. Direct conversion like this is the most efficient conversion method. It does not lose data or formatting but keeps the output PDF looking like the input Excel file.
To specify security options when saving to PDF, use PdfSaveOptions.
You may also opt to use the PdfSaveOptions class to set different attributes for the conversion. Setting different properties of PdfSaveOptions class will give you the control over the Print, Font, Security and Compression settings for the resultant PDF file. Most notable property is the Compliance that enables you to save the Excel files to PDF/A compliant PDF files.
Below provided code snippet demonstrates the usage of the PdfSaveOptions class to save the Excel files to PDF/A compliant PDF format.
For Aspose.Cells versions prior to version 2.3.0 you need to use a component like Aspose.PDF for Java to convert spreadsheets to PDF files. Aspose.Cells and Aspose.PDF work together to convert a spreadsheet to PDF via an intermediate step.
To convert spreadsheets to PDF with Aspose.Cells and Aspose.PDF:
The above steps are implemented below in an example.
We work hard to improve conversion and other aspects of Aspose.Cells with every release. Excel to PDF conversion has a few limitations. Some format settings specified in a spreadsheet might be lost, and not all drawing objects are supported.
The table below lists all features that are fully or partially supported when exporting to PDF using Aspose.Cells. This table is not final and does not cover all the spreadsheet attributes. It can also identify those features that may not be supported or are partially supported for the conversion.
| Document Element | Attribute | Net Supported | Notes |
|---|---|---|---|
| Alignment | Yes | ||
| Rotation | Partially | Only supports 90 and -90. | |
| Background settings | Yes | ||
| Border | Color | Yes | |
| Border | Line style | Yes | |
| Border | Line width | Yes | |
| Cell Data | Yes | ||
| Comments | No | ||
| Conditional Formatting | Yes | ||
| Document Properties | Yes | ||
| Drawing Objects | Yes | ||
| Font | Size | Yes | |
| Font | Color | Yes | |
| Font | Style | Yes | |
| Font | Underline | Yes | |
| Font | Effects | Partially | Only the strike-through effect is supported |
| Images | Yes | ||
| Hyperlink | Yes | ||
| Charts | Yes | ||
| Merged Cells | Yes | ||
| Page Break | Yes | ||
| Page Setup | Header/Footer | Yes | |
| Page Setup | Margins | Yes | |
| Page Setup | Page Orientation | Yes | |
| Page Setup | Page Size | Yes | |
| Page Setup | Print Area | Yes | |
| Page Setup | Print Titles | Yes | |
| Page Setup | Scaling | Yes | |
| Row Height/Column Width | Yes |
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.