Last active
February 5, 2022 13:24
-
-
Save aspose-com-kb/3d7764e4c2249d9f987ffcdb1becaeb9 to your computer and use it in GitHub Desktop.
This code can be used to convert Excel to PDF in C++. For more details, refer to the article https://kb.aspose.com/cells/cpp/how-to-convert-excel-to-pdf-using-cpp/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "Aspose.Cells.h" | |
using namespace std; | |
class ExcelToPDFEx | |
{ | |
public: | |
void ConvertExcelWorkbookToPDF() | |
{ | |
// Set Aspose.Cells API License | |
intrusive_ptr<License> LicenseForExcelToPDF = new License(); | |
LicenseForExcelToPDF->SetLicense(new String("Aspose.Cells.NET.lic")); | |
// Load the sample input Excel | |
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook(new String("input.xlsx")); | |
// Save the output Excel Document in PDF format | |
workbook->Save(new String("OutputExcelToPDF.pdf"), SaveFormat_Pdf); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment