Last active
January 22, 2020 18:02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merger-Ruby-v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
securityApi = GroupDocsMergerCloud::SecurityApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::Options.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/one-page.docx' | |
options.file_info.password = 'password' | |
options.output_path = "Output/add-password.docx" | |
result = securityApi.add_password(GroupDocsMergerCloud::AddPasswordRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
pagesApi = GroupDocsMergerCloud::PagesApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::OrientationOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/four-pages.docx' | |
options.output_path = "Output/change-page-orientation.docx" | |
options.pages = [2, 4] | |
options.mode = "Landscape" | |
result = pagesApi.orientation(GroupDocsMergerCloud::OrientationRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
securityApi = GroupDocsMergerCloud::SecurityApi.from_keys($app_sid, $app_key) | |
result = securityApi.check_password(GroupDocsMergerCloud::CheckPasswordRequest.new("WordProcessing/password-protected.docx")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Files | |
def self.Merger_Ruby_Copy_File() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FileApi_Instance() | |
$request = GroupDocsMergerCloud::CopyFileRequest.new("source.docx", "mergerdocs\\source.docx", $myStorage, $myStorage) | |
$response = $api.copy_file($request) | |
puts("Expected response type is Void: 'mergerdocs/source.docx' file copied as 'mergerdocs/source-copied.docx'.") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Folder | |
def self.Merger_Ruby_Copy_Folder() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FolderApi_Instance() | |
$request = GroupDocsMergerCloud::CopyFolderRequest.new("mergerdocs", "mergerdocs1", $myStorage, $myStorage) | |
$response = $api.copy_folder($request) | |
puts("Expected response type is Void: 'mergerdocs' folder copied as 'mergerdocs1'.") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Folder | |
def self.Merger_Ruby_Create_Folder() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FolderApi_Instance() | |
$request = GroupDocsMergerCloud::CreateFolderRequest.new("mergerdocs", $myStorage) | |
$response = $api.create_folder($request) | |
puts("Expected response type is Void: 'mergerdocs' folder created.") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Files | |
def self.Merger_Ruby_Delete_File() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FileApi_Instance() | |
$request = GroupDocsMergerCloud::DeleteFileRequest.new("mergerdocs1/source.docx", $myStorage) | |
$response = $api.delete_file($request) | |
puts("Expected response type is Void: 'mergerdocs1/one-page.docx' deleted.") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Folder | |
def self.Merger_Ruby_Delete_Folder() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FolderApi_Instance() | |
$request = GroupDocsMergerCloud::DeleteFolderRequest.new("mergerdocs1", $myStorage, true) | |
$response = $api.delete_folder($request) | |
puts("Expected response type is Void: 'mergerdocs/mergerdocs1' folder deleted recursively.") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Files | |
def self.Merger_Ruby_Download_File() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FileApi_Instance() | |
$request = GroupDocsMergerCloud::DownloadFileRequest.new("mergerdocs/one-page.docx", $myStorage) | |
$response = $api.download_file($request) | |
puts("Expected response type is Stream: " + ($response).to_s) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
pagesApi = GroupDocsMergerCloud::PagesApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::ExtractOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/sample-10-pages.docx' | |
options.output_path = "Output/extract-pages-by-numbers.docx" | |
options.pages = [2, 4, 7] | |
result = pagesApi.extract(GroupDocsMergerCloud::ExtractRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
pagesApi = GroupDocsMergerCloud::PagesApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::ExtractOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/sample-10-pages.docx' | |
options.output_path = "Output/extract-pages-by-range.docx" | |
options.start_page_number = 1 | |
options.end_page_number = 10 | |
options.range_mode = "EvenPages" | |
result = pagesApi.extract(GroupDocsMergerCloud::ExtractRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Storage | |
def self.Merger_Ruby_Get_Disc_Usage() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_StorageApi_Instance() | |
$request = GroupDocsMergerCloud::GetDiscUsageRequest.new($myStorage) | |
$response = $api.get_disc_usage($request) | |
puts("Expected response type is DiscUsage: " + ($response).to_s) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Storage | |
def self.Merger_Ruby_Get_File_Versions() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_StorageApi_Instance() | |
$request = GroupDocsMergerCloud::GetFileVersionsRequest.new("mergerdocs/one-page.docx", $myStorage) | |
$response = $api.get_file_versions($request) | |
puts("Expected response type is FileVersions: " + ($response).to_s) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Folder | |
def self.Merger_Ruby_Get_Files_List() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FolderApi_Instance() | |
$request = GroupDocsMergerCloud::GetFilesListRequest.new("mergerdocs/sample.docx", $myStorage) | |
$response = $api.get_files_list($request) | |
puts("Expected response type is FilesList: " + ($response).to_s) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
infoApi = GroupDocsMergerCloud::InfoApi.from_keys($app_sid, $app_key) | |
fileInfo = GroupDocsMergerCloud::FileInfo.new | |
fileInfo.file_path = 'WordProcessing/password-protected.docx' | |
fileInfo.password = 'password' | |
request = GroupDocsMergerCloud::GetInfoRequest.new(fileInfo) | |
response = infoApi.get_info(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
infoApi = GroupDocsMergerCloud::InfoApi.from_keys($app_sid, $app_key) | |
result = infoApi.get_supported_file_formats() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
documentApi = GroupDocsMergerCloud::DocumentApi.from_keys($app_sid, $app_key) | |
item1 = GroupDocsMergerCloud::JoinItem.new | |
item1.file_info = GroupDocsMergerCloud::FileInfo.new | |
item1.file_info.file_path = 'WordProcessing/four-pages.docx' | |
item2 = GroupDocsMergerCloud::JoinItem.new | |
item2.file_info = GroupDocsMergerCloud::FileInfo.new | |
item2.file_info.file_path = 'WordProcessing/one-page.docx' | |
options = GroupDocsMergerCloud::JoinOptions.new | |
options.join_items = [item1, item2] | |
options.output_path = "Output/joined.docx" | |
result = documentApi.join(GroupDocsMergerCloud::JoinRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
documentApi = GroupDocsMergerCloud::DocumentApi.from_keys($app_sid, $app_key) | |
item1 = GroupDocsMergerCloud::JoinItem.new | |
item1.file_info = GroupDocsMergerCloud::FileInfo.new | |
item1.file_info.file_path = 'WordProcessing/sample-10-pages.docx' | |
item1.pages = [3, 6, 8] | |
item2 = GroupDocsMergerCloud::JoinItem.new | |
item2.file_info = GroupDocsMergerCloud::FileInfo.new | |
item2.file_info.file_path = 'WordProcessing/four-pages.docx' | |
item2.start_page_number = 1 | |
item2.end_page_number = 4 | |
item2.range_mode = "OddPages" | |
options = GroupDocsMergerCloud::JoinOptions.new | |
options.join_items = [item1, item2] | |
options.output_path = "Output/joined-pages.docx" | |
result = documentApi.join(GroupDocsMergerCloud::JoinRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Files | |
def self.Merger_Ruby_Move_File() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FileApi_Instance() | |
$request = GroupDocsMergerCloud::MoveFileRequest.new("mergerdocs/source.docx", "mergerdocs1/source.docx", $myStorage, $myStorage) | |
$response = $api.move_file($request) | |
puts("Expected response type is Void: 'mergerdocs/source.docx' file moved to 'mergerdocs1/source.docx'.") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Folder | |
def self.Merger_Ruby_Move_Folder() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FolderApi_Instance() | |
$request = GroupDocsMergerCloud::MoveFolderRequest.new("mergerdocs1", "mergerdocs/mergerdocs1", $myStorage, $myStorage) | |
$response = $api.move_folder($request) | |
puts("Expected response type is Void: 'mergerdocs1' folder moved to 'mergerdocs/mergerdocs1'.") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Merger.Cloud.Sdk.Api; | |
using GroupDocs.Merger.Cloud.Sdk.Client; | |
using GroupDocs.Merger.Cloud.Sdk.Model; | |
using GroupDocs.Merger.Cloud.Sdk.Model.Requests; | |
using System; | |
using FileInfo = GroupDocs.Merger.Cloud.Sdk.Model.FileInfo; | |
namespace GroupDocs.Merger.Cloud.Examples.CSharp | |
{ | |
/// <summary> | |
/// This example demonstrates how to move document page to a new position. | |
/// </summary> | |
public class MovePage | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new PagesApi(configuration); | |
try | |
{ | |
var fileInfo = new FileInfo | |
{ | |
FilePath = "WordProcessing/four-pages.docx" | |
}; | |
var options = new MoveOptions | |
{ | |
FileInfo = fileInfo, | |
OutputPath = "Output/move-pages.docx", | |
PageNumber = 1, | |
NewPageNumber = 2 | |
}; | |
var request = new MoveRequest(options); | |
var response = apiInstance.Move(request); | |
Console.WriteLine("Output file path: " + response.Path); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling api: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Storage | |
def self.Merger_Ruby_Object_Exists() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_StorageApi_Instance() | |
$request = GroupDocsMergerCloud::ObjectExistsRequest.new("mergerdocs/one-page.docx", $myStorage) | |
$response = $api.object_exists($request) | |
puts("Expected response type is ObjectExist: " + ($response).to_s) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
documentApi = GroupDocsMergerCloud::DocumentApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::PreviewOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/four-pages.docx' | |
options.output_path = "Output/preview-page" | |
options.pages = [1, 3] | |
options.format = "Png" | |
result = documentApi.preview(GroupDocsMergerCloud::PreviewRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
securityApi = GroupDocsMergerCloud::SecurityApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::Options.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/password-protected.docx' | |
options.file_info.password = 'password' | |
options.output_path = "Output/remove-password.docx" | |
result = securityApi.remove_password(GroupDocsMergerCloud::RemovePasswordRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
pagesApi = GroupDocsMergerCloud::PagesApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::RemoveOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/four-pages.docx' | |
options.output_path = "Output/remove-pages.docx" | |
options.pages = [2, 4] | |
result = pagesApi.remove(GroupDocsMergerCloud::RemoveRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
pagesApi = GroupDocsMergerCloud::PagesApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::RotateOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'Pdf/ten-pages.pdf' | |
options.output_path = "Output/rotate-pages.pdf" | |
options.pages = [2, 4] | |
options.mode = "Rotate90" | |
result = pagesApi.rotate(GroupDocsMergerCloud::RotateRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
documentApi = GroupDocsMergerCloud::DocumentApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::SplitOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/sample-10-pages.docx' | |
options.output_path = "Output/split-to-multipage-document" | |
options.pages = [3, 6, 8] | |
options.mode = "Intervals" | |
result = documentApi.split(GroupDocsMergerCloud::SplitRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
documentApi = GroupDocsMergerCloud::DocumentApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::SplitOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/sample-10-pages.docx' | |
options.output_path = "Output/split-document" | |
options.pages = [1, 3] | |
options.mode = "Pages" | |
result = documentApi.split(GroupDocsMergerCloud::SplitRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
documentApi = GroupDocsMergerCloud::DocumentApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::SplitOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/sample-10-pages.docx' | |
options.output_path = "Output/split-by-start-end-numbers" | |
options.start_page_number = 3 | |
options.end_page_number = 7 | |
options.mode = "Pages" | |
result = documentApi.split(GroupDocsMergerCloud::SplitRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
documentApi = GroupDocsMergerCloud::DocumentApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::SplitOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/sample-10-pages.docx' | |
options.output_path = "Output/split-by-start-end-numbers-with-filter" | |
options.start_page_number = 3 | |
options.end_page_number = 7 | |
options.range_mode = "OddPages" | |
options.mode = "Intervals" | |
result = documentApi.split(GroupDocsMergerCloud::SplitRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Storage | |
def self.Merger_Ruby_Storage_Exist() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_StorageApi_Instance() | |
$request = GroupDocsMergerCloud::StorageExistsRequest.new($myStorage) | |
$response = $api.storage_exists($request) | |
puts("Expected response type is StorageExist: " + ($response).to_s) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
pagesApi = GroupDocsMergerCloud::PagesApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::SwapOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/four-pages.docx' | |
options.output_path = "Output/swap-pages.docx" | |
options.first_page_number = 2 | |
options.second_page_number = 4 | |
result = pagesApi.swap(GroupDocsMergerCloud::SwapRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples | |
$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud | |
securityApi = GroupDocsMergerCloud::SecurityApi.from_keys($app_sid, $app_key) | |
options = GroupDocsMergerCloud::UpdatePasswordOptions.new | |
options.file_info = GroupDocsMergerCloud::FileInfo.new | |
options.file_info.file_path = 'WordProcessing/password-protected.docx' | |
options.file_info.password = 'password' | |
options.output_path = "Output/update-password.docx" | |
options.new_password = "NewPassword" | |
result = securityApi.update_password(GroupDocsMergerCloud::UpdatePasswordRequest.new(options)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the gem | |
require 'groupdocs_merger_cloud' | |
require 'common_utilities/Utils.rb' | |
class Working_With_Files | |
def self.Merger_Ruby_Upload_File() | |
# Getting instance of the API | |
$api = Common_Utilities.Get_FileApi_Instance() | |
$fileStream = File.new("src\\Resources\\mergerdocs\\source.docx", "r") | |
$request = GroupDocsMergerCloud::UploadFileRequest.new("mergerdocs/source1.docx", $fileStream, $myStorage) | |
$response = $api.upload_file($request) | |
$fileStream.close() | |
puts("Expected response type is FilesUploadResult: " + ($response).to_s) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment