C++を使用してExcelをPDFにレンダリングする際にタイムラインを描画する
Contents
[
Hide
]
ExcelをPDFにレンダリングする際のタイムラインの描画
タイムラインが適用されたExcelファイルがある場合、そのExcelをPDFにエクスポートし、タイムラインの設定を保持したまま出力できることをAspose.Cellsはサポートしています。単にタイムライン付きのExcelファイルをPDFにエクスポートすると、生成されたPDFにはタイムラインが表示されます。
以下のサンプルコードは、既存のタイムラインを含むサンプルExcelファイルをロードします。その後、ワークブックを出力PDFファイルとして保存します。以下のスクリーンショットは、ソースのExcelファイルと生成されたPDFファイルを比較したものです。

サンプルコード
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Load sample Excel file
U16String inputFilePath(u"input.xlsx");
std::unique_ptr<Workbook> wb = std::make_unique<Workbook>(inputFilePath);
// Save file to pdf
U16String outputFilePath(u"out.pdf");
wb->Save(outputFilePath, SaveFormat::Pdf);
std::cout << "Workbook saved successfully as PDF!" << std::endl;
Aspose::Cells::Cleanup();
return 0;
}
#include <aspose.cells.h>
using namespace Aspose::Cells;
int main() {
Aspose::Cells::Startup();
// Load the sample Excel file
Workbook workbook(u"input.xlsx");
// Save the workbook as a PDF file
workbook.Save(u"output.pdf", SaveFormat::Pdf);
Aspose::Cells::Cleanup();
return 0;
}