<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>nodejs rest api on Document Processing REST APIs | GroupDocs Cloud</title>
    <link>https://blog-qa.groupdocs.cloud/it/tag/nodejs-rest-api/</link>
    <description>Recent content in nodejs rest api on Document Processing REST APIs | GroupDocs Cloud</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>it</language>
    <lastBuildDate>Wed, 21 Oct 2026 13:18:44 +0000</lastBuildDate><atom:link href="https://blog-qa.groupdocs.cloud/it/tag/nodejs-rest-api/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Rimuovere gli oggetti di annotazione da PDF con REST in Node.JS</title>
      <link>https://blog-qa.groupdocs.cloud/it/annotation/remove-annotation-objects-from-pdf-with-rest-in-nodejs/</link>
      <pubDate>Wed, 21 Oct 2026 13:18:44 +0000</pubDate>
      
      <guid>https://blog-qa.groupdocs.cloud/it/annotation/remove-annotation-objects-from-pdf-with-rest-in-nodejs/</guid>
      <description>Scopri come rimuovere gli oggetti Annotation da PDF con REST in Node.JS usando GroupDocs.Annotation Cloud SDK. Guida passo‑passo con codice, cURL e pratiche.</description>
      <content:encoded><![CDATA[<p>Rimuovere note indesiderate, evidenziazioni o segni di inchiostro dai PDF è una necessità frequente quando si preparano documenti puliti per la distribuzione. <a href="https://products.groupdocs.cloud/annotation/nodejs/">GroupDocs.Annotation Cloud SDK for Node.js</a> offre una potente libreria basata su REST che consente di gestire le annotazioni <a href="https://docs.fileformat.com/pdf">PDF</a> in modo programmatico. Questa guida mostra come rimuovere gli oggetti Annotation da un PDF con REST in Node.JS, passo dopo passo. Vedrai un esempio di codice completo, comandi cURL equivalenti, consigli di configurazione e raccomandazioni sulle migliori pratiche per integrare la rimozione delle annotazioni nei tuoi servizi.</p>
<h2 id="esempio-completo-funzionante-per-rimuovere-gli-oggetti-di-annotazione-da-pdf-con-rest-in-nodejs">Esempio completo funzionante per rimuovere gli oggetti di annotazione da PDF con REST in Node.JS</h2>
<p>Questo esempio dimostra come caricare un PDF, eliminare tutte le sue annotazioni e scaricare il file pulito utilizzando il GroupDocs.Annotation SDK.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fs</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#39;fs&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">path</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#39;path&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/annotation-cloud&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Authentication =========================================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">clientId</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">clientSecret</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">clientId</span>, <span style="color:#a6e22e">clientSecret</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">AnnotationsApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">storageApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">StorageApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Local &amp; Remote file definitions =======================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">localInputPath</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">resolve</span>(<span style="color:#a6e22e">__dirname</span>, <span style="color:#e6db74">&#34;input.pdf&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">localOutputPath</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">resolve</span>(<span style="color:#a6e22e">__dirname</span>, <span style="color:#e6db74">&#34;output.pdf&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">remoteFilePath</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;input.pdf&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Main workflow ==========================================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>(<span style="color:#66d9ef">async</span> () =&gt; {
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 1. Upload PDF to GroupDocs Cloud storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileBytes</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">readFileSync</span>(<span style="color:#a6e22e">localInputPath</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">uploadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">UploadFileRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">file</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileBytes</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">uploadFile</span>(<span style="color:#a6e22e">uploadRequest</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 2. Build FileInfo object for the uploaded PDF
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileInfo</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">FileInfo</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 3. Retrieve all existing annotations
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">getAnnotationsRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">GetAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">getAnnotations</span>(<span style="color:#a6e22e">getAnnotationsRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationIds</span> <span style="color:#f92672">=</span> (<span style="color:#a6e22e">annotationsResult</span>.<span style="color:#a6e22e">annotations</span> <span style="color:#f92672">||</span> []).<span style="color:#a6e22e">map</span>(<span style="color:#a6e22e">a</span> =&gt; <span style="color:#a6e22e">a</span>.<span style="color:#a6e22e">id</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 4. Delete all annotations (if any)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">annotationIds</span>.<span style="color:#a6e22e">length</span> <span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">0</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">deleteRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DeleteAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">annotationIds</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">annotationIds</span>
</span></span><span style="display:flex;"><span>        });
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">deleteAnnotations</span>(<span style="color:#a6e22e">deleteRequest</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 5. Download the cleaned PDF back to local storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">downloadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DownloadFileRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileStream</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">downloadFile</span>(<span style="color:#a6e22e">downloadRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">writeFileSync</span>(<span style="color:#a6e22e">localOutputPath</span>, <span style="color:#a6e22e">fileStream</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">`All annotations removed. Clean file saved to </span><span style="color:#e6db74">${</span><span style="color:#a6e22e">localOutputPath</span><span style="color:#e6db74">}</span><span style="color:#e6db74">`</span>);
</span></span><span style="display:flex;"><span>})();
</span></span></code></pre></div><blockquote>
<p><strong>Nota:</strong> Questo esempio di codice dimostra la funzionalità principale. Prima di usarlo nel tuo progetto, assicurati di aggiornare tutti i percorsi dei file e i valori di configurazione per corrispondere al tuo ambiente reale, verifica che tutte le dipendenze richieste siano installate correttamente e testa accuratamente nel tuo ambiente di sviluppo. Se incontri problemi, consulta la <a href="https://docs.groupdocs.cloud/annotation/">documentazione ufficiale</a> o contatta il <a href="https://forum.groupdocs.cloud/c/annotation/10">team di supporto</a> per assistenza.</p>
</blockquote>
<h2 id="elimina-le-annotazioni-pdf-tramite-rest-api-usando-curl">Elimina le annotazioni PDF tramite REST API usando cURL</h2>
<p>Di seguito sono riportati i comandi cURL che eseguono lo stesso flusso di rimozione delle annotazioni tramite gli endpoint REST di GroupDocs.Annotation Cloud.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 1. Obtain an access token</span>
</span></span><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/auth/token&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;{\&#34;client_id\&#34;:\&#34;YOUR_CLIENT_ID\&#34;,\&#34;client_secret\&#34;:\&#34;YOUR_CLIENT_SECRET\&#34;}&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 2. Upload the source PDF</span>
</span></span><span style="display:flex;"><span>curl -X PUT <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     --data-binary <span style="color:#e6db74">&#34;@input.pdf&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 3. Retrieve annotation IDs</span>
</span></span><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/annotation/annotations?filePath=input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 4. Delete all retrieved annotations</span>
</span></span><span style="display:flex;"><span>curl -X DELETE <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/annotation/annotations?filePath=input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;{\&#34;annotationIds\&#34;:[\&#34;id1\&#34;,\&#34;id2\&#34;]}&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 5. Download the cleaned PDF</span>
</span></span><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -o output.pdf
</span></span></code></pre></div><p>Per un elenco completo di endpoint e parametri, consulta la <a href="https://reference.groupdocs.cloud/annotation/">documentazione ufficiale dell&rsquo;API</a>.</p>
<h2 id="come-rimuovere-gli-oggetti-di-annotazione-da-pdf-con-rest-in-nodejs">Come rimuovere gli oggetti di annotazione da PDF con REST in Node.JS</h2>
<ol>
<li><strong>Configurazione dell&rsquo;autenticazione</strong> - La classe <code>Configuration</code> viene istanziata con il tuo <code>clientId</code> e <code>clientSecret</code>, creando un contesto autenticato per tutte le successive chiamate API.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">clientId</span>, <span style="color:#a6e22e">clientSecret</span>);
</span></span></code></pre></div></li>
<li><strong>Caricamento del file</strong> - <code>UploadFileRequest</code> invia i byte PDF locali allo storage di GroupDocs Cloud. Il metodo <code>storageApi.uploadFile</code> gestisce il trasferimento.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">uploadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">UploadFileRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">file</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileBytes</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">uploadFile</span>(<span style="color:#a6e22e">uploadRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Recupero delle annotazioni</strong> - <code>GetAnnotationsRequest</code> costruisce un oggetto di richiesta con un riferimento <code>FileInfo</code>. La chiamata <code>annotationsApi.getAnnotations</code> restituisce una collezione di oggetti annotazione, da cui vengono estratti gli ID.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">getAnnotationsRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">GetAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">getAnnotations</span>(<span style="color:#a6e22e">getAnnotationsRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Eliminazione delle annotazioni</strong> - Se esistono ID, <code>DeleteAnnotationsRequest</code> viene popolato e passato a <code>annotationsApi.deleteAnnotations</code>, che rimuove permanentemente le annotazioni dal PDF memorizzato.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">deleteRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DeleteAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">annotationIds</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">annotationIds</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">deleteAnnotations</span>(<span style="color:#a6e22e">deleteRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Download del PDF pulito</strong> - Infine, <code>DownloadFileRequest</code> recupera il file aggiornato e <code>fs.writeFileSync</code> lo scrive nel filesystem locale.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">downloadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DownloadFileRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileStream</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">downloadFile</span>(<span style="color:#a6e22e">downloadRequest</span>);
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">writeFileSync</span>(<span style="color:#a6e22e">localOutputPath</span>, <span style="color:#a6e22e">fileStream</span>);
</span></span></code></pre></div></li>
</ol>
<p>Per le definizioni dettagliate di classi e metodi, fare riferimento al <a href="https://reference.groupdocs.cloud/annotation/">riferimento API</a>.</p>
<h2 id="installazione-e-configurazione-di-groupdocsannotation-cloud-sdk-for-nodejs">Installazione e configurazione di GroupDocs.Annotation Cloud SDK for Node.js</h2>
<p>L&rsquo;SDK è distribuito come pacchetto npm. Installalo con il comando riportato di seguito e poi richiedilo nel tuo progetto.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install groupdocs-annotation-cloud
</span></span></code></pre></div><p>Puoi anche scaricare l&rsquo;ultimo pacchetto direttamente dalla <a href="https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-node">pagina dei rilasci su GitHub</a> o dall&rsquo;<a href="https://releases.groupdocs.cloud/annotation/nodejs/">URL di download ufficiale</a>.</p>
<p>Dopo l&rsquo;installazione, importa la libreria e crea un oggetto di configurazione come mostrato nell&rsquo;esempio di codice:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/annotation-cloud&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>, <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>);
</span></span></code></pre></div><p>Assicurati che il tuo ambiente di runtime soddisfi i requisiti della versione di Node.js e che tu abbia un account GroupDocs valido per ottenere le credenziali client.</p>
<h2 id="opzioni-e-impostazioni-per-la-rimozione-delle-annotazioni">Opzioni e impostazioni per la rimozione delle annotazioni</h2>
<p>L&rsquo;SDK espone diversi parametri che è possibile regolare:</p>
<ul>
<li><strong>clientId / clientSecret</strong> - Credenziali per l&rsquo;autenticazione OAuth. Impostale nel costruttore <code>Configuration</code>.</li>
<li><strong>fileInfo.filePath</strong> - Il percorso del PDF nello storage di GroupDocs Cloud. Modificalo se memorizzi i file in una cartella diversa.</li>
<li><strong>annotationIds</strong> - Un array di ID restituiti da <code>GetAnnotations</code>. Fornire un sottoinsieme consente la cancellazione selettiva.</li>
</ul>
<p>Impostazioni aggiuntive come i timeout delle richieste e la configurazione del proxy sono disponibili nella documentazione SDK; consulta la <a href="https://docs.groupdocs.cloud/annotation/">documentazione ufficiale</a> per l&rsquo;elenco completo.</p>
<h2 id="best-practices-per-la-rimozione-delle-annotazioni-pdf-tramite-rest">Best Practices per la rimozione delle annotazioni PDF tramite REST</h2>
<ul>
<li><strong>Convalida gli ID delle annotazioni</strong> - Verifica sempre che gli ID che intendi eliminare esistano; tentare di eliminare ID inesistenti può causare un errore 404.</li>
<li><strong>Usa HTTPS</strong> - Tutte le chiamate API devono essere eseguite tramite HTTPS per proteggere le tue credenziali e i dati dei documenti.</li>
<li><strong>Gestisci file di grandi dimensioni con upload a blocchi</strong> - Per i PDF più grandi di 100 MB, preferisci l&rsquo;endpoint di upload multipart per evitare timeout.</li>
<li><strong>Registra le risposte API</strong> - Memorizza gli ID delle richieste e le risposte per tracce di audit e una più facile risoluzione dei problemi.</li>
<li><strong>Riutilizza i token di accesso</strong> - Memorizza nella cache il token OAuth fino alla scadenza per ridurre il carico di autenticazione.</li>
</ul>
<h2 id="domande-comuni">Domande comuni</h2>
<ul>
<li>
<p><strong>Come posso autenticarmi con l&rsquo;API GroupDocs.Annotation Cloud?</strong><br>
Ottieni un client ID e un segreto dal tuo account GroupDocs, quindi richiedi un token di accesso tramite l&rsquo;endpoint OAuth. Consulta la <a href="https://docs.groupdocs.cloud/annotation/">documentazione ufficiale</a> per i dettagli.</p>
</li>
<li>
<p><strong>Posso eliminare annotazioni specifiche invece di tutte?</strong><br>
Sì, fornisci gli ID delle annotazioni che desideri rimuovere nella DeleteAnnotationsRequest. L&rsquo;SDK restituisce l&rsquo;elenco degli ID delle annotazioni dopo una chiamata GetAnnotations.</p>
</li>
<li>
<p><strong>Come posso rimuovere gli oggetti Annotation da PDF con REST in Node.JS?</strong><br>
Utilizza il GroupDocs.Annotation Cloud SDK for Node.js per chiamare l&rsquo;endpoint DeleteAnnotations dopo aver recuperato gli ID delle annotazioni. Il flusso completo è mostrato nell&rsquo;esempio di codice e nella sezione cURL di questa guida.</p>
</li>
<li>
<p><strong>Quale licenza è necessaria per l&rsquo;uso in produzione?</strong><br>
È necessaria una licenza a pagamento per la produzione. È possibile ottenere una licenza temporanea dalla <a href="https://purchase.groupdocs.cloud/temporary-license/">pagina della licenza temporanea</a> durante la valutazione.</p>
</li>
</ul>
<h2 id="further-reading">Further Reading</h2>
<ul>
<li><a href="https://blog.groupdocs.cloud/it/annotation/extract-or-remove-annotations-from-pdf-using-rest-api-in-node-js/">Estrai o rimuovi le annotazioni da PDF usando l&rsquo;API REST in Node.js</a></li>
<li><a href="https://blog.groupdocs.cloud/it/annotation/strikethrough-text-in-a-pdf-using-nodejs/">Testo barrato in un PDF con Node.js e API REST</a></li>
<li><a href="https://blog.groupdocs.cloud/it/annotation/remove-annotations-from-pdf-using-rest-api-in-python/">Rimuovi le annotazioni da PDF usando l&rsquo;API REST in Python</a></li>
</ul>
]]></content:encoded>
    </item>
    
    <item>
      <title>Modifica foglio Excel tramite REST in Node.JS</title>
      <link>https://blog-qa.groupdocs.cloud/it/editor/edit-excel-sheet-via-rest-in-nodejs/</link>
      <pubDate>Fri, 02 Oct 2026 14:32:02 +0000</pubDate>
      
      <guid>https://blog-qa.groupdocs.cloud/it/editor/edit-excel-sheet-via-rest-in-nodejs/</guid>
      <description>Scopri come modificare un file Excel in Node.js tramite REST usando GroupDocs.Editor Cloud SDK. La guida copre la configurazione, un esempio di codice, chiamate cURL e suggerimenti sulle prestazioni.</description>
      <content:encoded><![CDATA[<p>Automatizzare gli aggiornamenti dei fogli di calcolo è una necessità comune quando si costruiscono servizi web basati sui dati o pipeline di reporting. Il <a href="https://products.groupdocs.cloud/editor/nodejs/">GroupDocs.Editor Cloud SDK for Node.js</a> consente di modificare file Excel in Node.js tramite REST con poche righe di codice. In questo tutorial vedrai come configurare l&rsquo;SDK, caricare una cartella di lavoro <a href="https://docs.fileformat.com/spreadsheet/xlsx/">XLSX</a>, modificare una <a href="https://docs.fileformat.com/spreadsheet/cell/">cella</a>, salvare le modifiche e ottenere lo stesso risultato usando chiamate cURL grezze. Discuteremo anche delle funzionalità chiave, delle opzioni di configurazione e delle considerazioni sulle prestazioni per aiutarti a integrare la modifica di Excel in modo efficiente.</p>
<h2 id="modifica-file-excel-in-nodejs-tramite-rest---guida-in-5-passaggi">Modifica file Excel in Node.js tramite REST - Guida in 5 passaggi</h2>
<ol>
<li><strong>Installa l&rsquo;SDK e configura le credenziali</strong>: Imposta il tuo <code>CLIENT_ID</code> e <code>CLIENT_SECRET</code> in modo che la libreria possa autenticarsi con GroupDocs Cloud.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_ID</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_SECRET</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">CLIENT_ID</span>, <span style="color:#a6e22e">CLIENT_SECRET</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditApi</span>(<span style="color:#a6e22e">config</span>);
</span></span></code></pre></div><ol start="2">
<li><strong>Carica la cartella di lavoro Excel per la modifica</strong>: Usa <code>EditDocumentRequest</code> per aprire il file memorizzato nel tuo cloud storage.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditDocumentRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">FileInfo</span>({ <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;input.xlsx&#34;</span> })
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">editDocument</span>(<span style="color:#a6e22e">editRequest</span>);
</span></span></code></pre></div><ol start="3">
<li><strong>Recupera il primo foglio di lavoro e individua la cella di destinazione</strong>: L&rsquo;SDK restituisce un oggetto <code>document</code> che contiene fogli di lavoro e celle.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">worksheet</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.document.<span style="color:#a6e22e">worksheets</span>[<span style="color:#ae81ff">0</span>];
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">let</span> <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">find</span>(<span style="color:#a6e22e">c</span> =&gt; <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">rowIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">columnIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span>);
</span></span></code></pre></div><ol start="4">
<li><strong>Aggiorna o crea il valore della cella</strong>: Modifica il contenuto della cella <strong>A1</strong> (oppure aggiungila se non esiste).</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">if</span> (<span style="color:#f92672">!</span><span style="color:#a6e22e">targetCell</span>) {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Cell</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">rowIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">columnIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">value</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">push</span>(<span style="color:#a6e22e">targetCell</span>);
</span></span><span style="display:flex;"><span>} <span style="color:#66d9ef">else</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">targetCell</span>.<span style="color:#a6e22e">value</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><ol start="5">
<li><strong>Salva la cartella di lavoro modificata nello storage</strong>: Fornisci un <code>outputPath</code> e chiama <code>saveDocument</code>.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({ <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span> });
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveDocumentRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">documentId</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">editResult</span>.<span style="color:#a6e22e">documentId</span>,
</span></span><span style="display:flex;"><span>    document<span style="color:#f92672">:</span> <span style="color:#a6e22e">editResult</span>.document,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">saveOptions</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">saveOptions</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">saveDocument</span>(<span style="color:#a6e22e">saveRequest</span>);
</span></span></code></pre></div><p>Per un elenco completo di classi e metodi, consulta la <a href="https://reference.groupdocs.cloud/editor/">riferimento API</a>.</p>
<h2 id="modifica-file-excel-in-nodejs-tramite-rest---esempio-di-codice-completo">Modifica file Excel in Node.js tramite REST - Esempio di codice completo</h2>
<p>Il seguente esempio dimostra come modificare un file Excel in Node.js tramite REST utilizzando GroupDocs.Editor Cloud SDK.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/editor-cloud&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Replace with your actual GroupDocs Cloud credentials
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_ID</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_SECRET</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Paths for the source Excel file and the edited result
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">INPUT_FILE_PATH</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;input.xlsx&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">OUTPUT_FILE_PATH</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">editExcel</span>() {
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// Configure the SDK
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">CLIENT_ID</span>, <span style="color:#a6e22e">CLIENT_SECRET</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 1. Load the Excel workbook for editing
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditDocumentRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">FileInfo</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">INPUT_FILE_PATH</span>
</span></span><span style="display:flex;"><span>        })
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">editDocument</span>(<span style="color:#a6e22e">editRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">documentId</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.<span style="color:#a6e22e">documentId</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> document <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.document;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 2. Retrieve the first worksheet
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">worksheet</span> <span style="color:#f92672">=</span> document.<span style="color:#a6e22e">worksheets</span>[<span style="color:#ae81ff">0</span>];
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 3. Update cell A1 (rowIndex = 0, columnIndex = 0) with a new value
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">let</span> <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">find</span>(<span style="color:#a6e22e">c</span> =&gt; <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">rowIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">columnIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> (<span style="color:#f92672">!</span><span style="color:#a6e22e">targetCell</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Cell</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">rowIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">columnIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">value</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>
</span></span><span style="display:flex;"><span>        });
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">push</span>(<span style="color:#a6e22e">targetCell</span>);
</span></span><span style="display:flex;"><span>    } <span style="color:#66d9ef">else</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">targetCell</span>.<span style="color:#a6e22e">value</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 4. Save the edited workbook back to storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">OUTPUT_FILE_PATH</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveDocumentRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">documentId</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">documentId</span>,
</span></span><span style="display:flex;"><span>        document<span style="color:#f92672">:</span> document,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">saveOptions</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">saveOptions</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">saveDocument</span>(<span style="color:#a6e22e">saveRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">`Edited file saved to: </span><span style="color:#e6db74">${</span><span style="color:#a6e22e">saveResult</span>.<span style="color:#a6e22e">path</span><span style="color:#e6db74">}</span><span style="color:#e6db74">`</span>);
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Execute the edit operation
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">editExcel</span>().<span style="color:#66d9ef">catch</span>(<span style="color:#a6e22e">error</span> =&gt; {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">error</span>(<span style="color:#e6db74">&#34;Error during Excel editing:&#34;</span>, <span style="color:#a6e22e">error</span>);
</span></span><span style="display:flex;"><span>});
</span></span></code></pre></div><blockquote>
<p><strong>Nota:</strong> Questo esempio di codice dimostra la funzionalità principale. Prima di usarlo nel tuo progetto, assicurati di aggiornare tutti i percorsi dei file e i valori di configurazione per corrispondere al tuo ambiente reale, verifica che tutte le dipendenze richieste siano installate correttamente e testa accuratamente nel tuo ambiente di sviluppo. Se riscontri problemi, consulta la <a href="https://docs.groupdocs.cloud/editor/">documentazione ufficiale</a> o contatta il <a href="https://forum.groupdocs.cloud/c/editor/20">team di supporto</a> per assistenza.</p>
</blockquote>
<h2 id="aggiorna-foglio-xlsx-usando-lapi-rest-in-nodejs-via-curl">Aggiorna foglio XLSX usando l&rsquo;API REST in Node.js via cURL</h2>
<p>Di seguito è una rapida panoramica della stessa operazione usando chiamate HTTP grezze. Sostituisci i valori segnaposto con le tue credenziali effettive e i nomi dei file.</p>
<ol>
<li><strong>Ottieni un token di accesso</strong></li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/connect/token&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/x-www-form-urlencoded&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;client_id=YOUR_CLIENT_ID&amp;client_secret=YOUR_CLIENT_SECRET&amp;grant_type=client_credentials&#34;</span>
</span></span></code></pre></div><p>La risposta contiene <code>access_token</code>.</p>
<ol start="2">
<li><strong>Carica il file XLSX di origine</strong></li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.xlsx&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -F <span style="color:#e6db74">&#34;file=@input.xlsx&#34;</span>
</span></span></code></pre></div><ol start="3">
<li>
<p><strong>Modifica la cartella di lavoro (modifica la cella A1)</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/editor/edit&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#39;{
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           &#34;fileInfo&#34;: { &#34;filePath&#34;: &#34;input.xlsx&#34; },
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           &#34;options&#34;: {
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">               &#34;cells&#34;: [
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">                   { &#34;rowIndex&#34;: 0, &#34;columnIndex&#34;: 0, &#34;value&#34;: &#34;Edited via GroupDocs Editor Cloud&#34; }
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">               ]
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           }
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">         }&#39;</span>
</span></span></code></pre></div></li>
<li>
<p><strong>Scarica il file modificato</strong></p>
</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/output.xlsx&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -o output.xlsx
</span></span></code></pre></div><p>Per ulteriori dettagli sui payload di richiesta, vedere la <a href="https://reference.groupdocs.cloud/editor/">documentazione ufficiale dell&rsquo;API</a>.</p>
<h2 id="prerequisiti-e-configurazione-per-groupdocseditor-cloud-sdk-per-nodejs">Prerequisiti e configurazione per GroupDocs.Editor Cloud SDK per Node.js</h2>
<p>Per iniziare a utilizzare l&rsquo;SDK, è necessario Node.js 14 o versioni successive e un account GroupDocs Cloud.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install groupdocs-editor-cloud
</span></span></code></pre></div><p>Puoi anche scaricare l&rsquo;ultimo pacchetto dalla <a href="https://releases.groupdocs.cloud/editor/nodejs/">pagina di rilascio</a>. Dopo l&rsquo;installazione, crea un <code>client_id</code> e un <code>client_secret</code> nella tua dashboard di GroupDocs Cloud e conservali al sicuro.</p>
<h2 id="cosa-rende-groupdocseditor-cloud-sdk-for-nodejs-ideale-per-modificare-i-fogli-di-lavoro-excel">Cosa rende GroupDocs.Editor Cloud SDK for Node.js ideale per modificare i fogli di lavoro Excel</h2>
<ul>
<li><strong>Full XLSX support</strong> - Carica, modifica e salva le cartelle di lavoro preservando formule, stili e convalida dei dati.</li>
<li><strong>Cell‑level editing</strong> - Accedi a singole celle, righe o colonne programmaticamente, ideale per aggiornare report o dashboard.</li>
<li><strong>Cloud storage integration</strong> - Lavora direttamente con i file archiviati in GroupDocs Cloud senza scaricarli localmente.</li>
<li><strong>Secure REST communication</strong> - Tutte le operazioni avvengono su HTTPS e l&rsquo;SDK gestisce per te la gestione dei token.</li>
</ul>
<p>Per un&rsquo;analisi più approfondita, fai riferimento alla <a href="https://docs.groupdocs.cloud/editor/">documentazione</a>.</p>
<h2 id="ottimizzazione-delle-opzioni-di-modifica-di-excel-in-groupdocseditor-cloud">Ottimizzazione delle opzioni di modifica di Excel in GroupDocs.Editor Cloud</h2>
<p>Il SDK espone diverse opzioni che consentono di controllare come viene salvato il workbook modificato.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// You can also set compression level, password protection, etc.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>});
</span></span></code></pre></div><ul>
<li><strong><code>outputPath</code></strong> - Percorso di destinazione nell&rsquo;archiviazione cloud.</li>
<li><strong><code>compressionLevel</code></strong> - Riduce le dimensioni del file per cartelle di lavoro di grandi dimensioni (disponibile nella documentazione API).</li>
<li><strong><code>password</code></strong> - Proteggi il file risultante con una password, se necessario.</li>
</ul>
<p>Regola queste impostazioni per soddisfare le esigenze di sicurezza e prestazioni del tuo progetto.</p>
<h2 id="considerazioni-sulle-prestazioni-per-la-modifica-di-cartelle-di-lavoro-xlsx-tramite-rest">Considerazioni sulle prestazioni per la modifica di cartelle di lavoro XLSX tramite REST</h2>
<ol>
<li><strong>Riutilizza l&rsquo;oggetto di configurazione</strong> - Creare una nuova <code>Configuration</code> per ogni richiesta aggiunge overhead. Mantieni un&rsquo;unica istanza per tutta la durata della tua applicazione.</li>
<li><strong>Aggiorna le celle in batch</strong> - Se devi modificare molte celle, raccoglile in un array e invia una singola richiesta di modifica invece di più chiamate.</li>
<li><strong>Limita le dimensioni del foglio di lavoro</strong> - Fogli di lavoro molto grandi aumentano il consumo di memoria. Considera di suddividere i dati su più fogli quando possibile.</li>
<li><strong>Evita salvataggi non necessari</strong> - Chiama <code>saveDocument</code> solo dopo che tutte le modifiche richieste sono state applicate per ridurre le operazioni di I/O.</li>
</ol>
<h2 id="conclusione">Conclusione</h2>
<p>Modificare un file Excel in Node.js tramite REST diventa semplice con il <a href="https://products.groupdocs.cloud/editor/nodejs/">GroupDocs.Editor Cloud SDK for Node.js</a>. È possibile caricare programmaticamente una cartella di lavoro, modificare le celle e salvare il risultato utilizzando solo poche chiamate API o semplici comandi cURL. L&rsquo;architettura basata sul cloud dell&rsquo;SDK elimina la necessità di installazioni locali di Office e si adatta al carico di lavoro della tua applicazione. Per le distribuzioni in produzione, acquista una licenza che si adatti al tuo modello di utilizzo, e puoi anche ottenere una licenza temporanea per i test dalla <a href="https://purchase.groupdocs.cloud/temporary-license/">pagina della licenza temporanea</a>. Inizia a integrare la modifica di Excel oggi stesso e ottimizza i tuoi flussi di elaborazione dei dati.</p>
<h2 id="faqs">FAQs</h2>
<p><strong>Come modificare un file Excel in Node.js tramite REST senza scrivere codice HTTP personalizzato?</strong><br>
Utilizza il GroupDocs.Editor Cloud SDK for Node.js, che astrae le chiamate REST e ti consente di modificare un file Excel in Node.js tramite REST con semplici invocazioni di metodo.</p>
<p><strong>Posso aggiornare un foglio XLSX usando l&rsquo;API REST Node.js per file di grandi dimensioni?</strong><br>
Sì. L&rsquo;SDK trasmette i dati in streaming e supporta aggiornamenti batch, rendendolo adatto a cartelle di lavoro di grandi dimensioni. Regola <code>compressionLevel</code> e le modifiche batch delle celle per migliorare le prestazioni.</p>
<p><strong>Qual è il modo migliore per modificare un foglio di lavoro Excel programmaticamente con Node.js?</strong><br>
Lavora con gli oggetti <code>worksheet</code> e <code>cell</code> restituiti da <code>editDocument</code>. Questo ti dà il pieno controllo su righe, colonne e valori delle celle senza uscire dall&rsquo;ambiente Node.js.</p>
<p><strong>Dove posso trovare informazioni su prezzi e licenze?</strong><br>
Tutti i dettagli della licenza, inclusi i livelli di prezzo e una licenza temporanea per la valutazione, sono disponibili nella <a href="https://purchase.groupdocs.cloud/temporary-license/">pagina della licenza temporanea</a>.</p>
<h2 id="leggi-di-più">Leggi di più</h2>
<ul>
<li><a href="https://blog.groupdocs.cloud/it/editor/edit-excel-sheet-via-rest-in-java/">Modifica foglio Excel tramite REST in Java</a></li>
<li><a href="https://blog.groupdocs.cloud/it/editor/edit-excel-sheet-using-rest-api-in-python/">Modifica foglio Excel usando l&rsquo;API REST in Python</a></li>
<li><a href="https://blog.groupdocs.cloud/it/editor/best-practices-for-csv-editor-development-in-java/">Migliori pratiche per lo sviluppo dell&rsquo;editor CSV in Java</a></li>
</ul>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
