Kurulum
Contents
[
Hide
]
Aspose.Slides for Node.js via .NET, platformdan bağımsız bir API’dir ve Node.js ve edge-js köprüsü kurulu olan herhangi bir platformda (Windows, Linux ve MacOS) kullanılabilir.
NPM’den Kurulum
Bu komutla NPM üzerinden Aspose.Slides for Node.js via .NET’i kolayca kurabilirsiniz:
$ npm install aspose.slides.via.net
Kurulum sırasında bir sorunla karşılaşırsanız, lütfen https://www.npmjs.com/package/edge-js adresine bakınız.
ZIP arşivinden kurulum
Aspose.Slides for Node.js via .NET’i bir ZIP arşivinden kurup kullanmak için, bunun yerine bu talimatları izleyin:
Windows
- .NET6 veya üzerini kurun.
- Node.js’i (https://nodejs.org/en/download/) kurun ve node.exe’yi
PATH‘e ekleyin. - edge-js’i kurun.
$ mkdir aspose.slides.nodejs.net
$ cd aspose.slides.nodejs.net
$ npm install -g edge-js
- Aspose.Slides for Node.js via .NET’i indir ve
aspose.slides.nodejs/node_modules/aspose.slides.via.netdizinine çıkarın. - Aşağıdaki örnek kodu kullanarak
aspose.slides.nodejs.netklasöründehello.jsadlı bir dosya oluşturun:
// PowerPoint dosya manipülasyonu için Aspose.Slides modülünü içe aktar
const asposeSlides = require('aspose.slides.via.net');
// asposeSlides'tan gerekli sınıfları ekle
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;
const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");
// Temel işlevselliği göstermek için boş bir sunum oluştur ve kaydet
function createEmptyPresentation() {
// Yeni bir boş sunum başlat
var emptyPresentation = new Presentation();
// Boş sunumu PPTX formatında kaydet
emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
// Sunumla ilişkili kaynakları serbest bırak
emptyPresentation.dispose();
}
createEmptyPresentation(); // Boş bir sunum oluşturmak için fonksiyonu çalıştır
- Şimdi komut istemcisinde
node hello.jskomutunu çalıştırarak çalıştırın.
Linux
- .NET6 veya üzerini kurun.
- Node.js’i (https://nodejs.org/en/download/) kurun ve node.exe’yi
PATH‘e ekleyin. - edge-js’i kurun.
$ mkdir aspose.slides.nodejs.net
$ cd aspose.slides.nodejs.net
$ npm install edge-js
- Aspose.Slides for Node.js via Java’ı indir ve
aspose.slides.nodejs/node_modules/aspose.slides.via.netdizinine çıkarın. aspose.slides.nodejs.netklasöründe bu örnek kodu kullanarakhello.jsadlı bir test dosyası oluşturun:
// PowerPoint dosya manipülasyonu için Aspose.Slides modülünü içe aktar
const asposeSlides = require('aspose.slides.via.net');
// asposeSlides'tan gerekli sınıfları ekle
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;
const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");
// Temel işlevselliği göstermek için boş bir sunum oluştur ve kaydet
function createEmptyPresentation() {
// Yeni bir boş sunum başlat
var emptyPresentation = new Presentation();
// Boş sunumu PPTX formatında kaydet
emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
// Sunumla ilişkili kaynakları serbest bırak
emptyPresentation.dispose();
}
createEmptyPresentation(); // Boş bir sunum oluşturmak için fonksiyonu çalıştır
- Şimdi komut istemcisinde
node hello.jskomutunu çalıştırarak çalıştırın.
Mac
- .NET6 veya üzerini kurun.
- Node.js’i (https://nodejs.org/en/download/) kurun ve node.exe’yi
PATH‘e ekleyin. - edge-js’i kurun.
$ mkdir aspose.slides.nodejs.net
$ cd aspose.slides.nodejs.net
$ npm install edge-js
```javascript
// PowerPoint dosya manipülasyonu için Aspose.Slides modülünü içe aktar
const asposeSlides = require('aspose.slides.via.net');
// asposeSlides'tan gerekli sınıfları ekle
const { Presentation, SaveFormat, PdfOptions } = asposeSlides;
const fs = require('fs');
if (!fs.existsSync("out")) fs.mkdirSync("out");
// Temel işlevselliği göstermek için boş bir sunum oluştur ve kaydet
function createEmptyPresentation() {
// Yeni bir boş sunum başlat
var emptyPresentation = new Presentation();
// Boş sunumu PPTX formatında kaydet
emptyPresentation.save("out/emptyPresentation.pptx", SaveFormat.Pptx);
// Sunumla ilişkili kaynakları serbest bırak
emptyPresentation.dispose();
}
createEmptyPresentation(); // Boş bir sunum oluşturmak için fonksiyonu çalıştır
9. Şimdi komut istemcisinde `node hello.js` komutunu çalıştırarak çalıştırın.