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

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

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

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

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

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

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

// 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? = "bmp"     
    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.bmp"
            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 إلى BMP

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


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

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