working on it ...

Filters

Explore Public Snippets

Sort by

Found 5,420 snippets matching: cloud

    public by johansonkatherine modified May 8, 2014  219636  1  6  2

    C# Code Sample to Replace Multiple Texts inside PDF File Using Cloud API

    The following code sample shows how developers can replace multiple texts in a single API call in a PDF file using Aspose.Pdf for Cloud API in their applications. Developers can use Aspose REST API with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more.
    AsposeApp.AppSID  = "77***********************************";
    AsposeApp.AppKey = "9a*******************************";
    
    //build URI
    stringstrURI = "http://api.aspose.com/v1.1/pdf/test.pdf/replaceTextList";
    
    //sign URI
    stringsignedURI = Utils.Sign(strURI);
    
    //build JSON to post
    TextReplace textReplace1 = new TextReplace();
    textReplace1.OldValue = "[!firm!]";
    textReplace1.NewValue = "Aspose";
    textReplace1.Regex = "false";
    
    //build JSON to post
    TextReplace textReplace2 = new TextReplace();
    textReplace2.OldValue = "[!client!]";
    textReplace2.NewValue = "Mark";
    textReplace2.Regex = "false";
    
    MultipleTextReplacestextReplaces = new MultipleTextReplaces();
    textReplaces.TextReplaces = new TextReplace[] { textReplace1, textReplace2 };
    stringstrJSON = JsonConvert.SerializeObject(textReplaces);
    Console.Write(strJSON);
    Utils.ProcessCommand(signedURI, "POST", strJSON);
    
    //build URI
    strURI = "http://api.aspose.com/v1.1/storage/file/test.pdf";
    
    //sign URI
    signedURI = Utils.Sign(strURI);
    
    Stream responseStream = Utils.ProcessCommand(signedURI, "GET");
    using (Stream fileStream = System.IO.File.OpenWrite(@"test.pdf"))
    {
    Utils.CopyStream(responseStream, fileStream);
    }
    responseStream.Close();
    
    //Following are required classes
    public class MultipleTextReplaces
        {
    publicTextReplace[] TextReplaces { get; set; }
        }
    public class TextReplace
        {
    publicTextReplace() { }
    
    public string OldValue { get; set; }
    public string NewValue { get; set; }
    public string Regex { get; set; }
    
        }
    

    public by Kenichi Sasaki modified Jan 4, 2016  73737  1  3  0

    RDS cloudwatch aws cli

    RDS cloudwatch aws cli: gistfile1.txt
    aws cloudwatch get-metric-statistics --namespace AWS/RDS --metric-name FreeStorageSpace --start-time 2016-01-04T14:00:00 --end-time 2016-01-04T14:01:00 --period 60 --statistics Minimum --dimensions Name=DBInstanceIdentifier,Value=development
    
    

    public by Geometry modified Aug 7, 2016  1059  0  6  0

    Shift: Shift cloud by adding specified value to all points in the collection.

    Shift cloud by adding specified value to all points in the collection. Collection of points to shift their coordinates. Point to shift by.
    /// <summary>
    /// Shift cloud by adding specified value to all points in the collection.
    /// </summary>
    /// 
    /// <param name="cloud">Collection of points to shift their coordinates.</param>
    /// <param name="shift">Point to shift by.</param>
    /// 
    public static void Shift( IList<IntPoint> cloud, IntPoint shift )
    {
        for ( int i = 0, n = cloud.Count; i < n; i++ )
        {
            cloud[i] = cloud[i] + shift;
        }
    }

    public by johansonkatherine modified Apr 11, 2014  6245  1  8  5

    Convert PDF from Remote Server to other Format using Aspose.Pdf for Cloud API in PHP

    Aspose.PDF for Cloud API has released PHP SDK which allows PHP developers to convert PDF files uploaded to a remote server to other formats. You can pass URL and format parameters to specify the PDF’s URL and output format and use the PUT method of the convert resource to convert remote PDF files. You can download Aspose Cloud PHP SDK from the link
    use Aspose\Cloud\Common\AsposeApp;
    use Aspose\Cloud\Common\Product;
    use Aspose\Cloud\Pdf\Converter;
    
    AsposeApp::$appSID = '3395ba5c-***';
    AsposeApp::$appKey = 'e8dd1b0cd***';
    
    /* * Creating the object of Pdf Converter Class with a perameter $fileName */
    $Obj = new Converter('path/to/pdf/file.pdf');
    
    // Call convertByUrl method.
    $Obj->convertByUrl('http://url-to-pdf.com/file.pdf','tiff','outputfile.tiff');
    
    

    public by cghersi modified Sep 7, 2018  188  1  3  0

    Retrieve BLOB From Azure Blob Storage

    Quick method to retrieve a set of BLOBs for Azure Blob Storage, given their names. Unfortunately the Azure REST APIs don't allow, yet, to BULK retrieve the content of several BLOBs in one single call, so we need to loop over each BLOB and retrieve the content one by one
    public static Dictionary<Guid, byte[]> GetBlobs(List<string> names)
    {
      Dictionary<string, byte[]> result = new Dictionary<string, byte[]>();
    
      // retrieve info about the interesting BLOBs:
      IEnumerable<CloudBlob> blobs = s_defaultContainer.ListBlobs().
        OfType<CloudBlob>().Where(c => names.Contains(c.Name));
      
      // loop over the retrieved BLOBs:
      foreach (CloudBlob b in blobs)
      {
      	b.FetchAttributes(); //otherwise we cannot query for Properties...
      	byte[] res = new byte[b.Properties.Length];
      	
      	// download the actual content:
      	b.DownloadToByteArray(res, 0); 
      	
      	result.Add(b.Name, res);
      }
      
      return result;
    }

    public by johansonkatherine modified Mar 13, 2014  3955  1  7  3

    Merge multiple PDFs using PHP REST API

    PHP developers can learn how to merge multiple PDF files into a single PDF file using PHP REST API and SDK. To merge PDFs, you need to upload input PDFs to Aspose for Cloud Service or any supported third party storage and then send a PUT request to Aspose for Cloud service. This REST example uses PHP CURL library to send HTTP request and handle
    /**** Section 1 ****/        
    
    $appSID = '77****-****-****-****-80*********';
    $appKey = '****************';
    //build URI to merge PDFs
    $strURI = 'http://api.aspose.com/v1.1/pdf/MergedFile.pdf/merge';
    //sign URI
    $signedURI = sign($strURI, $appSID, $appKey);
    
    /**** End Section 1 ****/
    
    /**** Section 2 ****/
    
    //Build JSON to post
    $documentsList = array('List'=> array('input1.pdf', 'input2.pdf', 'input3.pdf'));
    $json = json_encode($documentsList);
    
    /**** End Section 2 ****/
    
    /**** Section 3 ****/
    $responseStream = processCommand($signedURI, 'PUT', 'json', $json);
    
    /**** End Section 3 ****/
    
    /**** Section 4 ****/
    
    //Download merged PDF
    //build URI
    $strURI = 'http://stage.aspose.com/v1.1/storage/file/MergedFile.pdf';
    //sign URI
    $signedURI = sign($strURI, $appSID, $appKey);
    $responseStream = processCommand($signedURI, "GET", "", "");
    $outputPath = getcwd() . '/output/MergedFile.pdf';
    saveFile($responseStream, $outputPath);
    echo 'Files have been merged and output file has been saved at: ' . $outputPath;
    
    /**** End Section 4 ****/ 
    

    public by johansonkatherine modified Mar 13, 2014  3848  0  7  4

    Merge multiple PDFs using PHP SDK from Aspose

    PHP developers can learn how to merge multiple PDF files into a single PDF file using PHP SDK from Aspose. You can use the following given supported third party storage to access Aspose for Cloud service. https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP In order to use PHP SDK, you need to perform following steps: - Set base
    use Aspose\Cloud\Common\AsposeApp;
    use Aspose\Cloud\Common\Utils;
    use Aspose\Cloud\Common\Product;
    use Aspose\Cloud\Storage\Folder;
    use Aspose\Cloud\Pdf\Document;
    
    /**** Section 1 ****/
    
    AsposeApp::$appSID = "77****-****-****-****-80*********";
    AsposeApp::$appKey = "******************";
    $baseProductUri= "http://api.aspose.com/v1.1";
    AsposeApp::$outPutLocation = getcwd() . "/Output/";
    
    /**** End Section 1 ****/
    
    /**** Section 2 ****/
    
    $inputFile1 = getcwd() . "/Input/input1.pdf";
    $inputFile2 = getcwd() . "/Input/input2.pdf";
    $inputFile3 = getcwd() . "/Input/input3.pdf";
    $mergedFileName = "MergedFile.pdf";
    //upload input PDF files
    echo "Uploading main document...<br />";
    $folder = new Folder();
    $folder->UploadFile($inputFile1, "");
    $folder->UploadFile($inputFile2, "");
    $folder->UploadFile($inputFile3, "");
    echo "input files uploaded <br />";
    
    /**** End Section 2 ****/
    
    /**** Section 3 ****/
    echo "Merging PDF files... <br />";
    //create Document object
    $doc = new Document($mergedFileName);
    $result = $doc->mergeDocuments(array('input1.pdf','input2.pdf','input3.pdf'));
    
    /**** End Section 3 ****/
    
    

    public by johansonkatherine modified Apr 3, 2014  4394  0  6  1

    Split Excel Worksheets into New Workbooks and to any Image Format using Cloud API in Ruby

    Cloud Developers can now use ruby language to split excel workbook into single worksheets and save all or specific worksheets as new workbooks, TIFFs or other images format by using Aspose.Cells for Cloud API. To split workbooks, you need to upload the input Excel files to Aspose for Cloud or any supported third party storage and then send a POST r
    #######
    Section 1 ######
    app_sid = '####### Section 1 ######
    app_sid = '77******-1***-4***-a***-80**********'
    app_key = '*********************'
    Aspose::Cloud::Common::AsposeApp.new(app_sid, app_key)
    #build URI to split workbook
    str_uri = 'http://api.aspose.com/v1.1/cells/Sample.xlsx/split?format=png';
    #uncomment following line to split specific worksheets
    #str_uri = 'http://api.aspose.com/v1.1/cells/Sample.xlsx/split?from=2&to=3&format=tiff';
    #sign URI
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri);
    #######
    End Section 1 ######
    #######
    Section 2 ######
    #Split spreadsheet file
    response_stream = RestClient.post(signed_uri, '', {:accept=>:json})
    #######
    End Section 2 #####
    
    #Download Split Files
    
    stream_hash = JSON.parse(response_stream)
    stream_hash['Result']['Documents'].each do |document|
    
           #Build and sign URI to download split files
    
    file_name = File.basename(document['link']['Href'])
    str_uri = 'http://api.aspose.com/v1.1/storage/file/' + file_name;             
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri);
    
    file_name = File.basename(str_uri)
    
          #Download and save split files
    
    response_stream = RestClient.get(signed_uri, :accept => 'application/json')
          Aspose::Cloud::Common::Utils.save_file(response_stream, file_name)
    
    End
    

    public by johansonkatherine modified Mar 26, 2014  3966  0  6  3

    Merge Multiple Word Documents into Single Doc using REST API in Python

    This REST example uses pycurl library to send HTTP request and handle HTTP response so you need to install it to use this example. Once input Word documents are uploaded, you can use the following URI to merge documents on Aspose for Cloud or any supported third party storage. http://api.aspose.com/v1.1/words/MainDocument.docx/appendDocument
          ####### Section 1 ######
          # specify App SID
    AsposeApp.app_sid = '77****-****-****-****-80*********'
          # specify App Key
    AsposeApp.app_key = '******************'
          #build URI to merge PDFs
    str_uri = 'http://api.aspose.com/v1.1/words/MainDocument.docx/appendDocument'
          #sign URI
    signed_uri = Utils.sign(Utils(), str_uri)
    
          ####### End Section 1 ######
    
          ####### Section 2 ######
          #Build JSON to post
          json_document1 = json.dumps({'Href' : 'AppendDocument1.docx', 'ImportFormatMode' : 'KeepSourceFormatting'})
          json_document2 = json.dumps({'Href' : 'AppendDocument2.docx', 'ImportFormatMode' : 'UseDestinationStyles'})
    json_arr = '{\'DocumentEntries\':[' + json_document1 + ',' + json_document2 + ']}'
    
       ####### End Section 2 ######
    
         ####### Section 3 ######
    Utils.process_command(Utils(), signed_uri, 'POST', 'JSON', json_arr)
          ####### End Section 3 ######
    
          ####### Section 4 ######
    
          #build URI to download output file
    str_uri = 'http://api.aspose.com/v1.1/storage/file/MainDocument.docx'
          #sign URI
    signed_uri = Utils.sign(Utils(), str_uri)
    response_stream = Utils.process_command(Utils(),signed_uri, 'GET')
    Utils.save_file(Utils(),response_stream, 'MergedFile.docx')
    
          ####### End Section 4 ###### 
    

    public by johansonkatherine modified Jun 10, 2014  3575  1  6  3

    Convert Email to Other Formats using Cloud API in Ruby

    This technical tip shows how developers can convert email messages to other formats like EML, MSG & MHT in cloud using ruby language.
    require 'path/to/lib/asposecloudsdk'
    
    app_sid = '****'
    app_key = '****'
    
    Aspose::Cloud::Common::AsposeApp.app_key = app_key
    Aspose::Cloud::Common::AsposeApp.app_sid = app_sid
    Aspose::Cloud::Common::AsposeApp.output_location = ''
    Aspose::Cloud::Common::Product.set_base_product_uri('http://api.aspose.com/v1.1')
    
    # Create Object of folder class
    folder = Aspose::Cloud::AsposeStorage::Folder.new
    folder.upload_file 'path/to/storage/email_test.eml'
    
    # Create object of converter
    con_obj = Aspose::Cloud::Email::Converter.new('path/to/storage/email_test.eml')
    con_obj.convert('msg')
    
    • Public Snippets
    • Channels Snippets