Why to Convert EPUB to XLTX?
EPUB is a popular file format for e-books, which is widely used for digital publications. It is an open standard format for digital books and publications, which is supported by most of the e-book readers. However, it is not supported by Microsoft Excel, which is the most popular spreadsheet application. Therefore, if you want to open and view the content of an EPUB file in Excel, you need to convert it to the XLTX format.
How Aspose.Total helps for EPUB to XLTX Conversion?
Aspose.Total for C++ is a comprehensive suite of file format automation libraries that enables developers to create, manipulate, convert, and render various file formats. It includes Aspose.PDF for C++, Aspose.Cells for C++, and other libraries. With the help of these libraries, you can easily convert EPUB to XLTX in C++. The process involves two steps.
In the first step, you can export EPUB to XLSX by using Aspose.PDF for C++. This library provides a powerful set of features to create, read, and manipulate PDF documents. It also enables you to convert PDF documents to other popular file formats, including XLSX.
In the second step, you can convert XLSX to XLTX by using Aspose.Cells for C++. This library provides a comprehensive set of features to create, manipulate, and convert spreadsheets. It enables you to convert XLSX to XLTX with just a few lines of code.
Therefore, with the help of Aspose.Total for C++, you can easily convert EPUB to XLTX in C++. It is a simple two-step process that requires minimal coding.
C++ API to Convert EPUB to XLTX
Get Started with C++ File Format APIs
Install from command line as nuget install Aspose.Total.Cpp
or via Package Manager Console of Visual Studio with Install-Package Aspose.Total.Cpp
.
Alternatively, get the offline MSI installer or DLLs in a ZIP file from downloads .
// supports PDF, CGM, EPUB, TeX, PCL, PS, SVG, XPS, MD, MHTML, XML, and XSLFO file format | |
// Load the PDF. | |
auto doc = MakeObject<Document>(u"sourceFile.pdf"); | |
// Save in XLSX format. | |
doc->Save(u"XlsxOutput.xlsx", SaveFormat::Xlsx); | |
// Load the XLSX. | |
intrusive_ptr<Aspose::Cells::IWorkbook> wkb = Factory::CreateIWorkbook(u"XlsxOutput.xlsx"); | |
// supports CSV, XLSB, XLSM, XLT, XLTX, XLTM, XLAM, TSV, TXT, ODS, DIF, MD, SXC, and FODS file format | |
// Save in CSV format. | |
wkb->Save(u"convertedFile.csv", SaveFormat_Csv); |
Get or Set EPUB File Information via C++
Aspose.PDF for C++ also allows you to get information about your EPUB document and lets you take informed decisions before your conversion process. In order to get file specific information of a EPUB file, you first need to call the get_Info() method of Document class. Once the DocumentInfo object is retrieved, you can get the values of the individual properties. Furthermore, you can also set the properties by using respective methods of DocumentInfo class.
// supports PDF, CGM, EPUB, TeX, PCL, PS, SVG, XPS, MD, MHTML, XML, and XSLFO file format | |
// load the PDF. | |
auto doc = MakeObject<Document>(L"DocumentInfo.pdf"); | |
// get document informtion object | |
info = doc->get_Info(); | |
// set author | |
info->set_Author(L"John Doe"); | |
// set subject | |
info->set_Subject(L"Working with Document Info"); | |
// set title | |
info->set_Title(L"Get/set document's info"); | |
// get and print document information | |
Console::WriteLine(L"Author: {0}", info->get_Author()); | |
Console::WriteLine(L"Subject: {0}", info->get_Subject()); | |
Console::WriteLine(L"Title: {0}", info->get_Title()); |
Save XLTX File Format to Stream via C++
Aspose.Cells for C++ allows saving XLTX file format to stream. To save files to a stream, create a MemoryStream or FileStream object and save the file to that stream object by calling the IWorkbook object’s Save method. Specify the desired file format using the SaveFormat enumeration when calling the Save method.
// supports CSV, XLSB, XLSM, XLT, XLTX, XLTM, XLAM, TSV, TXT, ODS, DIF, MD, SXC, and FODS file format | |
// load sample CSV file | |
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook("sampleExcelFile.csv"); | |
// create FileStream object | |
intrusive_ptr<FileStream> stream = new FileStream("outputSavingFiletoStream.csv"), FileMode_CreateNew); | |
// save the Workbook to Stream | |
workbook->Save(stream, SaveFormat_Csv); | |
// working with stream.. |