سويفت API لتحويل XLS إلى GIF

مكتبة سويفت لتحويل XLS إلى GIF

استخدم Cells تحويل REST API لإنشاء سير عمل جدول بيانات مخصص في Swift. يعد هذا حلاً احترافيًا لتحويل XLS إلى GIF وتنسيقات المستندات الأخرى عبر الإنترنت باستخدام Swift.

تحويل ملف XLS إلى GIF في Swift

API
PUT
https://api.aspose.cloud/v3.0/cells/convert

يعد تحويل تنسيقات الملفات من XLS إلى GIF مهمة معقدة. يتم تنفيذ جميع عمليات النقل من تنسيق XLS إلى GIF بواسطة Swift SDK الخاص بنا مع الحفاظ على المحتوى الهيكلي والمنطقي الرئيسي لجدول بيانات XLS المصدر. تعد مكتبة Swift الخاصة بنا حلاً احترافيًا لتحويل ملفات XLS إلى ملفات GIF عبر الإنترنت. يوفر Cloud SDK لمطوري Swift وظائف قوية ومخرجات GIF مثالية.

مثال على التعليمات البرمجية في Swift باستخدام REST API لتحويل تنسيق XLS إلى تنسيق GIF

// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-swift/
    import AsposeCellsCloud
    let expectation1 = self.expectation(description: "checkAuth")
    AsposeCellsCloudAPI.clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    AsposeCellsCloudAPI.clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    AuthAspose.checkAuth()
    {
        (authError) in
        guard authError == nil else {
            XCTFail("error checkAuth")
            return
        }
        expectation1.fulfill()
    }
    self.waitForExpectations(timeout: testTimeout, handler: nil)        
    let expectation = self.expectation(description: "PutConvert")
    let workbook:String = "Book1.xls"
    let format:String? = "gif"     
    let url1: URL? = getURL(workbook)
    let filedata = NSData(contentsOfFile: url1!.path)
    let password:String? = nil
    let outPath:String? = nil
    CellsAPI.cellsWorkbookPutConvertWorkbook(file: url1!, format: format, password: password, outPath: outPath)
    {
        (response, error) in
        guard error == nil else {
            let errorinfo = self.GetErrorDataInfo(error: error as! ErrorResponse)
            print("error info: \(errorinfo!)")
            XCTFail("error PutConvert")
            return
        }            
        if let response = response {
            //response is a Data of file, we may write it down and check it.
            let fileName = "dest.gif"
            let filePath = NSHomeDirectory()
            let fileManager = FileManager.default
            let path = "\(filePath)/tmp/\(fileName)"
            fileManager.createFile(atPath: path, contents:nil, attributes:nil)
            let handle = FileHandle(forWritingAtPath:path)
            handle?.write(response as Data)
            expectation.fulfill()
        }
    }
    self.waitForExpectations(timeout: testTimeout, handler: nil)


كيفية استخدام Swift API لتحويل XLS إلى GIF

  1. قم بإنشاء حساب علىلوحة القيادة للحصول على تفاصيل الحصص والترخيص API مجانًا
  2. تهيئة CellsApi باستخدام معرف العميل وسر العميل وعنوان URL الأساسي وإصدار API
  3. قم باستدعاء أسلوب cellWorkbookPutConvertWorkbook للحصول على الدفق الناتج


متطلبات النظام

  1. ماك مونتيري 12.4
  2. سويفت 4.2