C# REST API के साथ PowerPoint से नोट्स हटाएं

यह आलेख C# REST API के साथ ** PowerPoint से नोट्स हटाने के तरीके के बारे में मार्गदर्शन करता है। आप .NET-आधारित क्लाउड SDK का उपयोग करके C# लो कोड एपीआई के साथ PowerPoint में सभी नोट्स को कैसे हटाएं सीखेंगे। यह आपको नोट स्लाइड को हटाने के लिए एक नमूना कोड प्रदान करेगा और फिर नोट हटाए जाने की पुष्टि करेगा।

पूर्वावश्यकता

C# REST API के साथ PowerPoint से सभी नोट्स हटाने के चरण

  1. नोट्स हटाने के लिए क्रेडेंशियल्स के साथ SlidesApi क्लास का उपयोग करके एपीआई क्लाइंट को प्रारंभ करें
  2. UploadFile() विधि का उपयोग करके प्रेजेंटेशन को नोट्स के साथ अपलोड करें
  3. अपलोड किए गए फ़ाइल नाम और लक्ष्य स्लाइड नंबर का उपयोग करके DeleteNotesSlide() विधि को कॉल करें
  4. यह दिखाने के लिए संदेश प्रदर्शित करें कि लक्ष्य स्लाइड से नोट हटा दिए गए हैं
  5. नोट्स हटाने के बाद अद्यतन प्रस्तुतिकरण डाउनलोड करें

ये चरण वर्णन करते हैं C# REST इंटरफ़ेस के साथ PowerPoint में नोट्स कैसे हटाएं। लक्ष्य प्रस्तुति को क्लाउड स्टोरेज पर अपलोड करें और फ़ाइल नाम और लक्ष्य स्लाइड प्रदान करके DeleteNotesSlide() विधि को कॉल करें। प्रस्तुति में सभी स्लाइडों के लिए इस प्रक्रिया को दोहराएं और आउटपुट को डिस्क पर सहेजें।

C# REST इंटरफ़ेस के साथ PowerPoint में सभी नोट्स को हटाने के लिए कोड

using Aspose.Slides.Cloud.Sdk;
using Aspose.Slides.Cloud.Sdk.Model;
using System;
using System.IO;
namespace PresentationModifier
{
class SlideNotesRemover
{
static void Main(string[] args)
{
// Initialize the API client with credentials
var slidesApi = new SlidesApi("ID", "Secret");
// Define the presentation file name
string presentationFile = "PresentationExample.pptx";
// Upload the presentation to the server
var uploadResponse = slidesApi.UploadFile(presentationFile, new MemoryStream(File.ReadAllBytes(presentationFile)));
// Specify the slide number to modify (changed to slide 2)
int targetSlideNumber = 2;
// Remove the notes slide from the specified slide
Slide updatedSlide = slidesApi.DeleteNotesSlide(presentationFile, targetSlideNumber);
// Check if the notes slide exists after the operation
bool isNotesSlidePresent = updatedSlide.NotesSlide != null;
Console.WriteLine("Notes slide present: " + isNotesSlidePresent);
// Download the updated presentation from the server
Stream updatedFileStream = slidesApi.DownloadFile(presentationFile);
// Save the modified presentation locally
using (var fileStream = new FileStream("ModifiedPresentation.pptx", FileMode.Create, FileAccess.Write))
{
updatedFileStream.CopyTo(fileStream);
}
Console.WriteLine("Presentation updated and saved as 'ModifiedPresentation.pptx'.");
}
}
}

इस कोड ने प्रदर्शित किया है कि C# REST इंटरफ़ेस के साथ PowerPoint में नोट्स कैसे हटाएं। नोट्स हटाने से पहले और बाद में यह जांचने के लिए कि किसी स्लाइड में नोट्स हैं या नहीं, आप नोट्सस्लाइड ध्वज का उपयोग कर सकते हैं। नोट स्लाइड के अस्तित्व की जाँच करने के लिए, NotesSlideExists() विधि का उपयोग करें।

इस लेख ने हमें नोट्स हटाना सिखाया है. किसी प्रस्तुतिकरण में नोट्स जोड़ने के लिए, C# REST API के साथ PowerPoint स्लाइड में नोट्स जोड़ें पर लेख देखें।

 हिन्दी