Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Source directory path.
StringPtr srcDir = new String("..\\Data\\01_SourceDirectory\\");
// Output directory path.
StringPtr outDir = new String("..\\Data\\02_OutputDirectory\\");
// Path of input Excel file
StringPtr sampleConvertExcelWorkbookToPDF = srcDir->StringAppend(new String("sampleConvertExcelWorkbookToPDF.xlsx"));
// Path of output Pdf file
StringPtr outputConvertExcelWorkbookToPDF = outDir->StringAppend(new String("outputConvertExcelWorkbookToPDF_DirectConversion.pdf"));
// Load the sample Excel file.
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook(sampleConvertExcelWorkbookToPDF);
// Create pdf save options object.
intrusive_ptr<Aspose::Cells::IPdfSaveOptions> pdfSaveOptions = Factory::CreateIPdfSaveOptions();
// Set the compliance to PDF/A-1b.
pdfSaveOptions->SetCompliance(Aspose::Cells::Rendering::PdfCompliance_PdfA1b);
// Save the Excel Document in PDF format
workbook->Save(outputConvertExcelWorkbookToPDF, pdfSaveOptions);
// Source directory path.
StringPtr srcDir = new String("..\\Data\\01_SourceDirectory\\");
// Output directory path.
StringPtr outDir = new String("..\\Data\\02_OutputDirectory\\");
// Path of input Excel file
StringPtr sampleConvertExcelWorkbookToPDF = srcDir->StringAppend(new String("sampleConvertExcelWorkbookToPDF.xlsx"));
// Path of output Pdf file
StringPtr outputConvertExcelWorkbookToPDF = outDir->StringAppend(new String("outputConvertExcelWorkbookToPDF_DirectConversion.pdf"));
// Load the sample Excel file.
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook(sampleConvertExcelWorkbookToPDF);
// Create pdf save options object.
intrusive_ptr<Aspose::Cells::IPdfSaveOptions> pdfSaveOptions = Factory::CreateIPdfSaveOptions();
// Set the compliance to PDF/A-1b.
pdfSaveOptions->SetCreatedTime(new Aspose::Cells::Systems::DateTime(2017, 5, 25));
// Save the Excel Document in PDF format
workbook->Save(outputConvertExcelWorkbookToPDF, pdfSaveOptions);
// Source directory path.
StringPtr srcDir = new String("..\\Data\\01_SourceDirectory\\");
// Output directory path.
StringPtr outDir = new String("..\\Data\\02_OutputDirectory\\");
// Path of input Excel file
StringPtr sampleConvertExcelWorkbookToPDF = srcDir->StringAppend(new String("sampleConvertExcelWorkbookToPDF.xlsx"));
// Path of output Pdf file
StringPtr outputConvertExcelWorkbookToPDF = outDir->StringAppend(new String("outputConvertExcelWorkbookToPDF_DirectConversion.pdf"));
// Load the sample Excel file.
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook(sampleConvertExcelWorkbookToPDF);
// Save the Excel Document in PDF format
workbook->Save(outputConvertExcelWorkbookToPDF, SaveFormat_Pdf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment