使用C++渲染自定义日期格式g和ge mm dd
Contents
[
Hide
]
Aspose.Cells现在能够呈现类似于g、ge.mm.dd等自定义日期格式模式。请查看附加的源Excel文件(5112361.xlsx)和Aspose.Cells转换的PDF(5112360.pdf)作为参考。
下面的示例代码将转换包含类似于g和ge.mm.dd的自定义格式模式的源Excel文件(5112361.xlsx)成为输出PDF(5112360.pdf)。
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Create workbook from an existing Excel file
U16String inputFilePath = srcDir + u"SourceFile.xlsx";
Workbook workbook(inputFilePath);
// Save the Excel file as PDF
workbook.Save(outDir + u"CustomDateFormat_out.pdf");
std::cout << "File saved successfully as PDF!" << std::endl;
Aspose::Cells::Cleanup();
}