إضافة روابط فائقة النص للصور
Contents
[
Hide
]
الروابط التشعبية مفيدة للوصول إلى المعلومات على أوراق عمل أخرى أو على مواقع إلكترونية. تتيح Microsoft Excel للمستخدمين إضافة روابط تشعبية على النصوص في الخلايا، وعلى الصور. يمكن لروابط الصور التشعبية أن تسهل التنقل في ورقة العمل، على سبيل المثال، كأزرار التالي والسابق، أو الشعارات التي ترتبط بمواقع معينة. يشرح هذا المستند كيفية إدراج روابط صور تشعبية في ورقة عمل باستخدام Aspose.Cells for Node.js via C++.
تمكنك Aspose.Cells for Node.js via C++ من إضافة روابط تشعبية إلى الصور في جداول البيانات أثناء التشغيل. من الممكن تعيين وتعديل عنوان الرؤية وسرية الرابط. يوضح رمز العينة التالي كيفية إضافة رابط صورة تشعبية إلى ورقة عمل.
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
const AsposeCells = require("aspose.cells.node"); | |
const path = require("path"); | |
// The path to the documents directory. | |
const dataDir = path.join(__dirname, "data"); | |
// Create directory if it is not already present. | |
const fs = require("fs"); | |
if (!fs.existsSync(dataDir)) { | |
fs.mkdirSync(dataDir); | |
} | |
// Instantiate a new workbook | |
let workbook = new AsposeCells.Workbook(); | |
// Get the first worksheet | |
let worksheet = workbook.getWorksheets().get(0); | |
// Insert a string value to a cell | |
worksheet.getCells().get("C2").putValue("Image Hyperlink"); | |
// Set the 4th row height | |
worksheet.getCells().setRowHeight(3, 100); | |
// Set the C column width | |
worksheet.getCells().setColumnWidth(2, 21); | |
// Add a picture to the C4 cell | |
let index = worksheet.getPictures().add(3, 2, 4, 3, path.join(dataDir, "aspose-logo.jpg")); | |
// Get the picture object | |
let pic = worksheet.getPictures().get(index); | |
// Set the placement type | |
pic.setPlacement(AsposeCells.Drawing.PlacementType.FreeFloating); | |
// Add an image hyperlink | |
let hlink = pic.addHyperlink("http://www.aspose.com/"); | |
// Specify the screen tip | |
hlink.setScreenTip("Click to go to Aspose site"); | |
let outputFilePath = path.join(dataDir, "ImageHyperlink.out.xls"); | |
// Save the Excel file | |
workbook.save(outputFilePath); |