この Node.js の例は、GroupDocs.Watermark を使用してウォーターマークを検索および取得する方法を示し、効率的でスケーラブルな検索操作を示しています。
TypeScript
const groupdocsWatermark = require('@groupdocs/groupdocs.watermark')
const files = ["source.docx", "source.xlsx", "source.pptx", "source.vsdx"];
for (const file of files) {
// Node.js 環境をセットアップし、必要なドキュメントをロードします
const settings = new groupdocsWatermark.WatermarkerSettings();
settings.setSearchableObjects(new groupdocsWatermark.SearchableObjects());
settings.getSearchableObjects().setWordProcessingSearchableObjects(
groupdocsWatermark.WordProcessingSearchableObjects.Hyperlinks |
groupdocsWatermark.WordProcessingSearchableObjects.Text
);
settings.getSearchableObjects().setSpreadsheetSearchableObjects(
groupdocsWatermark.SpreadsheetSearchableObjects.HeadersFooters
);
settings.getSearchableObjects().setPresentationSearchableObjects(
groupdocsWatermark.PresentationSearchableObjects.SlidesBackgrounds |
groupdocsWatermark.PresentationSearchableObjects.Shapes
);
settings.getSearchableObjects().setDiagramSearchableObjects(groupdocsWatermark.DiagramSearchableObjects.None);
settings.getSearchableObjects().setPdfSearchableObjects(groupdocsWatermark.PdfSearchableObjects.All);
// さまざまな基準に基づいてウォーターマークを識別するように検索を設定します
const watermarker = new groupdocsWatermark.Watermarker(file, settings);
// ウォーターマーク検索を実行し、特定されたウォーターマークに関するデータを収集します
const watermarks = watermarker.search();
// 結果を処理して、ビジネスニーズに応じてウォーターマークを変更または削除します。
console.log(`In ${documentPath} found ${watermarks.getCount()} possible watermark(s).`);
watermarker.close();
}