レンダリング タイムライン
Contents
[
Hide
]
考えられる使用シナリオ
Aspose.Cells は、office 2013、office 2016、office 2019、および office 365 を使用せずにタイムライン シェイプのレンダリングをサポートします。ワークシートを画像に変換するか、ワークブックを PDF または HTML 形式で保存すると、タイムラインが適切にレンダリングされることがわかります。
レンダリング タイムライン
次のサンプル コードは、サンプル Excel ファイル既存のタイムラインが含まれています。タイムラインの名前に従ってシェイプ オブジェクトを取得し、Shape.ToImage() メソッドを使用して画像にレンダリングします。流れるイメージは出力画像レンダリングされたタイムラインを示します。ご覧のとおり、タイムラインは適切にレンダリングされており、サンプルの Excel ファイルと同じように見えます。
サンプルコード
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// Load sample Excel file containing timeline. | |
Workbook wb = new Workbook("input.xlsx"); | |
// Access second worksheet. | |
Worksheet sheet = wb.getWorksheets().get(1); | |
// Access the first Timeline inside the worksheet. | |
Timeline timeline = sheet.getTimelines().get(0); | |
ImageOrPrintOptions options = new ImageOrPrintOptions(); | |
options.setImageType(ImageType.PNG); | |
// Get timeline shape object by timeline's name | |
Shape timeLineShape = sheet.getShapes().get(timeline.getName()); | |
timeLineShape.toImage("out.png", options); |