Inserire un immagine collegata da indirizzo web con Node.js tramite C++

Utilizzando Microsoft Excel

In Microsoft Excel (ad esempio 2007):

  1. Fare clic sul menu Inserisci e selezionare Immagine.
  2. Specifica l’indirizzo web dell’immagine nella finestra di dialogo Inserisci immagine.

Usando Aspose.Cells for Node.js via C++

Aspose.Cells for Node.js via C++ supporta l’aggiunta di un’immagine collegata usando ShapeCollection.addLinkedPicture(upperLeftRow, upperLeftColumn, heightPixels, widthPixels, sourceFullName). Il metodo restituisce un oggetto Picture.

L’esempio seguente mostra come aggiungere un’immagine collegata da un indirizzo web a un foglio di lavoro.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Instantiate a new Workbook.
const workbook = new AsposeCells.Workbook();
// Insert a linked picture (from Web Address) to B2 Cell.
const pic = workbook.getWorksheets().get(0).getShapes().addLinkedPicture(1, 1, 100, 100, "http://www.aspose.com/Images/aspose-logo.jpg");
// Set the height and width of the inserted image.
pic.setHeightInch(1.04);
pic.setWidthInch(2.6);
// Save the Excel file.
workbook.save(path.join(dataDir, "outLinkedPicture.out.xlsx"));