<?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>pdf annotation removal on Document Processing REST APIs | GroupDocs Cloud</title>
    <link>https://blog-qa.groupdocs.cloud/it/tag/pdf-annotation-removal/</link>
    <description>Recent content in pdf annotation removal 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/pdf-annotation-removal/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>
    
  </channel>
</rss>
