asposecloud 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.project +18 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +71 -0
- data/Rakefile +1 -0
- data/Samples/Barcode/Test_Builder.rb +35 -0
- data/Samples/Barcode/Test_Reader.rb +34 -0
- data/Samples/Cells/Test_Converter.rb +34 -0
- data/Samples/Email/Test_Converter.rb +31 -0
- data/Samples/Email/Test_Document.rb +31 -0
- data/Samples/Pdf/Test_Converter.rb +38 -0
- data/Samples/Pdf/Test_TextEditor.rb +33 -0
- data/Samples/Slides/Test_Converter.rb +35 -0
- data/Samples/Storage/Test_Folder.rb +42 -0
- data/Samples/Words/Test_Converter.rb +34 -0
- data/Samples/tasks/Test_Converter.rb +31 -0
- data/Samples/tasks/Test_Document.rb +33 -0
- data/Tests/Data/barcodeQR.png +0 -0
- data/Tests/Data/email_test.eml +21 -0
- data/Tests/Data/email_test_attach.eml +64 -0
- data/Tests/Data/test_convert_cell.xlsx +0 -0
- data/Tests/Data/test_convert_slide.pptx +0 -0
- data/Tests/Data/test_convertlocal.docx +0 -0
- data/Tests/Data/test_convertlocal.pdf +0 -0
- data/Tests/Data/test_file_on_storage.pdf +0 -0
- data/Tests/Data/test_replace_text.pdf +0 -0
- data/Tests/Data/test_tasks.mpp +0 -0
- data/Tests/Data/test_uploadfile.docx +0 -0
- data/Tests/Output/barcodeQR.png +0 -0
- data/Tests/Output/converted_file.doc +0 -0
- data/Tests/Output/converted_file.pdf +0 -0
- data/Tests/Output/converted_file.tiff +0 -0
- data/Tests/Output/email_test.msg +0 -0
- data/Tests/Output/test_convert_slide.png +0 -0
- data/Tests/Output/test_file_on_storage.doc +0 -0
- data/Tests/Output/testfile.jpeg +0 -0
- data/Tests/barcode_tests.rb +45 -0
- data/Tests/cell_tests.rb +41 -0
- data/Tests/email_tests.rb +43 -0
- data/Tests/pdf_tests.rb +76 -0
- data/Tests/slide_tests.rb +41 -0
- data/Tests/storage_tests.rb +86 -0
- data/Tests/tasks_tests.rb +24 -0
- data/Tests/word_tests.rb +34 -0
- data/asposecloud.gemspec +24 -0
- data/lib/Barcode/builder.rb +45 -0
- data/lib/Barcode/reader.rb +65 -0
- data/lib/Cells/chart_editor.rb +91 -0
- data/lib/Cells/convertor.rb +144 -0
- data/lib/Cells/extractor.rb +86 -0
- data/lib/Cells/text_editor.rb +94 -0
- data/lib/Cells/workbook.rb +224 -0
- data/lib/Cells/worksheet.rb +375 -0
- data/lib/Common/aspose_app.rb +51 -0
- data/lib/Common/product.rb +34 -0
- data/lib/Common/utils.rb +172 -0
- data/lib/Email/converter.rb +50 -0
- data/lib/Email/document.rb +67 -0
- data/lib/Ocr/extractor.rb +105 -0
- data/lib/Pdf/annotation_editor.rb +263 -0
- data/lib/Pdf/converter.rb +127 -0
- data/lib/Pdf/document.rb +220 -0
- data/lib/Pdf/extractor.rb +107 -0
- data/lib/Pdf/text_editor.rb +121 -0
- data/lib/Slides/converter.rb +79 -0
- data/lib/Slides/document.rb +208 -0
- data/lib/Slides/extractor.rb +135 -0
- data/lib/Storage/folder.rb +128 -0
- data/lib/Words/builder.rb +82 -0
- data/lib/Words/converter.rb +67 -0
- data/lib/Words/document.rb +117 -0
- data/lib/Words/extractor.rb +153 -0
- data/lib/Words/mail_merge.rb +65 -0
- data/lib/aspose_barcode.rb +21 -0
- data/lib/aspose_cells.rb +24 -0
- data/lib/aspose_common.rb +29 -0
- data/lib/aspose_email.rb +20 -0
- data/lib/aspose_ocr.rb +21 -0
- data/lib/aspose_pdf.rb +23 -0
- data/lib/aspose_slides.rb +21 -0
- data/lib/aspose_storage.rb +19 -0
- data/lib/aspose_tasks.rb +23 -0
- data/lib/aspose_words.rb +23 -0
- data/lib/asposecloud.rb +29 -0
- data/lib/asposecloud/version.rb +3 -0
- data/lib/tasks/assignments.rb +71 -0
- data/lib/tasks/calendar.rb +56 -0
- data/lib/tasks/converter.rb +48 -0
- data/lib/tasks/document.rb +143 -0
- data/lib/tasks/resources.rb +69 -0
- metadata +187 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
# Require asposecloudsdk
|
19
|
+
require File.dirname(File.dirname(File.dirname(__FILE__))) + '/lib/asposecloud'
|
20
|
+
|
21
|
+
app_sid = '****'
|
22
|
+
app_key = '****'
|
23
|
+
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_key = app_key
|
25
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = app_sid
|
26
|
+
Aspose::Cloud::Common::AsposeApp.output_location = 'path/to/output/location/'
|
27
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://api.aspose.com/v1.1')
|
28
|
+
|
29
|
+
# Create object of words converter class
|
30
|
+
words_converter = Aspose::Cloud::Words::Converter.new('path/to/filename')
|
31
|
+
|
32
|
+
# Convert a local pdf file to any format (tiff,doc, etc)
|
33
|
+
# output file will be stored on local drive at output_location
|
34
|
+
words_converter.convert_local_file('path/to/input/filename.doc','output_filename_without_extension','output_extension')
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
# Require asposecloudsdk
|
19
|
+
require File.dirname(File.dirname(File.dirname(__FILE__))) + '/lib/asposecloud'
|
20
|
+
|
21
|
+
app_sid = '****'
|
22
|
+
app_key = '****'
|
23
|
+
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_key = app_key
|
25
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = app_sid
|
26
|
+
Aspose::Cloud::Common::AsposeApp.output_location = ''
|
27
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://api.aspose.com/v1.1')
|
28
|
+
|
29
|
+
# Create object of converter
|
30
|
+
con_obj = Aspose::Cloud::Tasks::Converter.new('path/to/storage/file.mpp')
|
31
|
+
con_obj.convert('pdf')
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
# Require asposecloudsdk
|
19
|
+
require File.dirname(File.dirname(File.dirname(__FILE__))) + '/lib/asposecloud'
|
20
|
+
|
21
|
+
app_sid = '****'
|
22
|
+
app_key = '****'
|
23
|
+
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_key = app_key
|
25
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = app_sid
|
26
|
+
Aspose::Cloud::Common::AsposeApp.output_location = ''
|
27
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://api.aspose.com/v1.1')
|
28
|
+
|
29
|
+
# Create object of Document
|
30
|
+
obj = Aspose::Cloud::Tasks::Document.new('path/to/storage/file.mpp')
|
31
|
+
puts obj.get_tasks()
|
32
|
+
puts obj.get_task(1)
|
33
|
+
puts obj.add_task('My Task',1)
|
Binary file
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Return-path: <masood@kpisol.com>
|
2
|
+
Envelope-to: masood@kpisol.com
|
3
|
+
Delivery-date: Wed, 14 May 2014 03:43:47 -0600
|
4
|
+
Received: from [115.186.144.164] (port=3158 helo=[192.168.1.101])
|
5
|
+
by box260.bluehost.com with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128)
|
6
|
+
(Exim 4.82)
|
7
|
+
(envelope-from <masood@kpisol.com>)
|
8
|
+
id 1WkVj0-0007hM-Sr
|
9
|
+
for masood@kpisol.com; Wed, 14 May 2014 03:43:47 -0600
|
10
|
+
Message-ID: <53733ACC.7050206@kpisol.com>
|
11
|
+
Date: Wed, 14 May 2014 14:43:40 +0500
|
12
|
+
From: Masood Anwer <masood@kpisol.com>
|
13
|
+
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
|
14
|
+
MIME-Version: 1.0
|
15
|
+
To: masood@kpisol.com
|
16
|
+
Subject: test
|
17
|
+
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
|
18
|
+
Content-Transfer-Encoding: 7bit
|
19
|
+
X-Identified-User: {2469:box260.bluehost.com:kpisolco:kpisol.com} {sentby:smtp auth 115.186.144.164 authed with masood@kpisol.com}
|
20
|
+
|
21
|
+
test message
|
@@ -0,0 +1,64 @@
|
|
1
|
+
Return-path: <masood@kpisol.com>
|
2
|
+
Envelope-to: masood@kpisol.com
|
3
|
+
Delivery-date: Wed, 14 May 2014 12:05:07 -0600
|
4
|
+
Received: from [182.188.145.203] (port=17969 helo=[192.168.1.101])
|
5
|
+
by box260.bluehost.com with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128)
|
6
|
+
(Exim 4.82)
|
7
|
+
(envelope-from <masood@kpisol.com>)
|
8
|
+
id 1WkdYA-0000uu-5p
|
9
|
+
for masood@kpisol.com; Wed, 14 May 2014 12:05:07 -0600
|
10
|
+
Message-ID: <5373B046.7050707@kpisol.com>
|
11
|
+
Date: Wed, 14 May 2014 23:04:54 +0500
|
12
|
+
From: Masood Anwer <masood@kpisol.com>
|
13
|
+
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
|
14
|
+
MIME-Version: 1.0
|
15
|
+
To: masood@kpisol.com
|
16
|
+
Subject: Attach doc
|
17
|
+
Content-Type: multipart/mixed;
|
18
|
+
boundary="------------040308050604060908060305"
|
19
|
+
X-Identified-User: {2469:box260.bluehost.com:kpisolco:kpisol.com} {sentby:smtp auth 182.188.145.203 authed with masood@kpisol.com}
|
20
|
+
|
21
|
+
This is a multi-part message in MIME format.
|
22
|
+
--------------040308050604060908060305
|
23
|
+
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
|
24
|
+
Content-Transfer-Encoding: 7bit
|
25
|
+
|
26
|
+
checking attachment with email.
|
27
|
+
|
28
|
+
--------------040308050604060908060305
|
29
|
+
Content-Type: text/plain; charset=windows-1252;
|
30
|
+
name="readme.txt"
|
31
|
+
Content-Transfer-Encoding: 7bit
|
32
|
+
Content-Disposition: attachment;
|
33
|
+
filename="readme.txt"
|
34
|
+
|
35
|
+
Aspose Cloud SDK Bundle
|
36
|
+
The goal of this bundle is to provide an easy way to integrate the Aspose Cloud SDK into a Symfony2 project.
|
37
|
+
|
38
|
+
1. Installation
|
39
|
+
AsposeCloudsdkBundle can be installed via Composer. Add the following to your composer.json file:
|
40
|
+
"aspose/cloud-sdk-bundle": "dev-master"
|
41
|
+
|
42
|
+
Then, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located:
|
43
|
+
composer.update
|
44
|
+
|
45
|
+
Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:
|
46
|
+
// app/AppKernel.php
|
47
|
+
public function registerBundles()
|
48
|
+
{
|
49
|
+
// ...
|
50
|
+
new Aspose\Bundle\CloudBundle\AsposeCloudBundle(),
|
51
|
+
// ...
|
52
|
+
);
|
53
|
+
}
|
54
|
+
|
55
|
+
2. Usage
|
56
|
+
AsposeCloudsdkBundle is called as a standard service.
|
57
|
+
$this->get('asposeapp');
|
58
|
+
This will return you object of Product class and you can access properties and methods of class.
|
59
|
+
|
60
|
+
3. License
|
61
|
+
This bundle is under the MIT license. See the complete license in the bundle:
|
62
|
+
Resources/meta/LICENSE
|
63
|
+
|
64
|
+
--------------040308050604060908060305--
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
require 'test/unit'
|
19
|
+
require_relative '../lib/asposecloud'
|
20
|
+
|
21
|
+
class BarcodeTests < Test::Unit::TestCase
|
22
|
+
def test_save_barcode
|
23
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
25
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
26
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
27
|
+
|
28
|
+
# Create object of barcode builder class
|
29
|
+
builder = Aspose::Cloud::Barcode::Builder.new
|
30
|
+
builder.save('Text to generate barcode','QR','png')
|
31
|
+
assert_equal true, File.exist?('./Output/barcodeQR.png')
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_read_barcode_local
|
35
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
36
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
37
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
38
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
39
|
+
|
40
|
+
# Create object of barcode reader class
|
41
|
+
reader = Aspose::Cloud::Barcode::Reader.new('storage_file_name.png')
|
42
|
+
response = reader.read_from_local_image('./Data/barcodeQR.png')
|
43
|
+
assert_instance_of Array, response
|
44
|
+
end
|
45
|
+
end
|
data/Tests/cell_tests.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
require 'test/unit'
|
19
|
+
require_relative '../lib/asposecloud'
|
20
|
+
|
21
|
+
class CellTests < Test::Unit::TestCase
|
22
|
+
def test_convert_storage_file
|
23
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
25
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
26
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
27
|
+
|
28
|
+
# Create Object of folder class
|
29
|
+
folder = Aspose::Cloud::AsposeStorage::Folder.new
|
30
|
+
response = folder.upload_file './Data/test_convert_cell.xlsx'
|
31
|
+
assert_equal true, response
|
32
|
+
|
33
|
+
# Create object of cell converter class
|
34
|
+
converter = Aspose::Cloud::Cells::Converter.new('test_convert_cell.xlsx')
|
35
|
+
assert_nothing_thrown 'Error' do
|
36
|
+
converter.convert('./Output/converted_file.tiff','tiff')
|
37
|
+
end
|
38
|
+
|
39
|
+
assert_equal true, File.exist?('./Output/converted_file.tiff')
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
require 'test/unit'
|
19
|
+
require_relative '../lib/asposecloud'
|
20
|
+
|
21
|
+
class EmailTests < Test::Unit::TestCase
|
22
|
+
|
23
|
+
def test_convert_storage_file
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
25
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
26
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
27
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
28
|
+
|
29
|
+
# Create Object of folder class
|
30
|
+
folder = Aspose::Cloud::AsposeStorage::Folder.new
|
31
|
+
response = folder.upload_file './Data/email_test.eml'
|
32
|
+
assert_equal true, response
|
33
|
+
|
34
|
+
# Create object of pdf converter class
|
35
|
+
converter = Aspose::Cloud::Email::Converter.new('email_test.eml')
|
36
|
+
assert_nothing_thrown 'Error' do
|
37
|
+
converter.convert('msg')
|
38
|
+
end
|
39
|
+
|
40
|
+
assert_equal true, File.exist?('./Output/email_test.msg')
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
data/Tests/pdf_tests.rb
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
require 'test/unit'
|
19
|
+
require_relative '../lib/asposecloud'
|
20
|
+
|
21
|
+
class PdfTests < Test::Unit::TestCase
|
22
|
+
|
23
|
+
def test_convert_local_file
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
25
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
26
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
27
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
28
|
+
|
29
|
+
# Create object of pdf converter class
|
30
|
+
converter = Aspose::Cloud::Pdf::Converter.new('file_on_storage.pdf')
|
31
|
+
|
32
|
+
converter.convert_local_file('./Data/test_convertlocal.pdf','./Output/converted_file.doc','doc')
|
33
|
+
assert_equal true, File.exist?('./Output/converted_file.doc')
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_convert_storage_file
|
37
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
38
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
39
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
40
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
41
|
+
|
42
|
+
# Create Object of folder class
|
43
|
+
folder = Aspose::Cloud::AsposeStorage::Folder.new
|
44
|
+
response = folder.upload_file './Data/test_file_on_storage.pdf'
|
45
|
+
assert_equal true, response
|
46
|
+
|
47
|
+
# Create object of pdf converter class
|
48
|
+
converter = Aspose::Cloud::Pdf::Converter.new('test_file_on_storage.pdf')
|
49
|
+
assert_nothing_thrown 'Error' do
|
50
|
+
converter.convert('doc')
|
51
|
+
end
|
52
|
+
|
53
|
+
assert_equal true, File.exist?('./Output/test_file_on_storage.doc')
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_replace_text
|
57
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
58
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
59
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
60
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
61
|
+
|
62
|
+
# Create Object of folder class
|
63
|
+
folder = Aspose::Cloud::AsposeStorage::Folder.new
|
64
|
+
response = folder.upload_file './Data/test_replace_text.pdf'
|
65
|
+
assert_equal true, response
|
66
|
+
|
67
|
+
# Create object of pdf text editor class
|
68
|
+
editor = Aspose::Cloud::Pdf::TextEditor.new('test_replace_text.pdf')
|
69
|
+
assert_nothing_thrown 'Error' do
|
70
|
+
response = editor.replace_text 'Kevin', 'Nick', false, 1
|
71
|
+
end
|
72
|
+
|
73
|
+
assert_equal true, response
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU General Public License
|
5
|
+
# as published by the Free Software Foundation; either version 3
|
6
|
+
# of the License, or (at your option) any later version.
|
7
|
+
# This program is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
# GNU General Public License for more details.
|
11
|
+
# You should have received a copy of the GNU General Public License
|
12
|
+
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
+
#
|
14
|
+
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
+
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
+
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
+
|
18
|
+
require 'test/unit'
|
19
|
+
require_relative '../lib/asposecloud'
|
20
|
+
|
21
|
+
class SlideTests < Test::Unit::TestCase
|
22
|
+
def test_convert_slide
|
23
|
+
Aspose::Cloud::Common::AsposeApp.app_key = '8356c76c7412f32bb85ae7472e842da4'
|
24
|
+
Aspose::Cloud::Common::AsposeApp.app_sid = '8EB6E644-4A40-4B50-8012-135D1F8F7513'
|
25
|
+
Aspose::Cloud::Common::AsposeApp.output_location = './Output/'
|
26
|
+
Aspose::Cloud::Common::Product.set_base_product_uri('http://test.aspose.com/v1.1')
|
27
|
+
|
28
|
+
# Create Object of folder class
|
29
|
+
folder = Aspose::Cloud::AsposeStorage::Folder.new
|
30
|
+
response = folder.upload_file './Data/test_convert_slide.pptx'
|
31
|
+
assert_equal true, response
|
32
|
+
|
33
|
+
# Create object of slides converter class
|
34
|
+
slides_converter = Aspose::Cloud::Slides::Converter.new('test_convert_slide.pptx')
|
35
|
+
assert_nothing_thrown 'Error' do
|
36
|
+
slides_converter.convert(1,'png')
|
37
|
+
end
|
38
|
+
|
39
|
+
assert_equal true, File.exist?('./Output/test_convert_slide.png')
|
40
|
+
end
|
41
|
+
end
|