You are not logged in.

Change Language:

Freelancer? Consultant? Check out: WorkTrail - Time Tracking made easy
Profile for saaspose

Name saaspose
Email Address n/a
Posts20
  • Add Page Number Field into Document Uploaded at Amazon S3 Storage
    Board » Django » Python Programming
    This technical tip allows developers to insert page number field into the Word document using Saaspose.Words REST API in your .NET applications. You need to upload file to Amazon S3 storage before running this example. Some important steps for performing this task are to specify product URI, serialize the JSON request content, build URI, sign URI, get response stream, required methods and classes are also given in detail. Please check Saaspose example section for more details on how to upload files to Amazon S3 storage.

    Sample Code for Inserting Page Number Field inDoc at Amazon S3 Storage

    SaasposeApp.AppKey = "9a******************";
    SaasposeApp.AppSID = "77*********************";
                //specify product URI
    Product.BaseProductUri = @"http://api.saaspose.com/v1.0";
    
    try
                {
    stringfileName = "Sample.doc";
    stringsaveFormat = "doc";
    stringoutputFile = "C:\\Output." + saveFormat;
    string amazonS3StorageName = "MyAmazonS3Storage";
    string amazonS3BucketName = "MyS3Bucket"; // include folder name if file is not at root folder 
    
                    //serialize the JSON request content
                    Field field = new Field();
    field.Alignment = "right";
    field.Format = "{PAGE} of {NUMPAGES}";
    field.IsTop = true;
    field.SetPageNumberOnFirstPage = true;
    
    stringstrJSON = JsonConvert.SerializeObject(field);
    
                    //build URI
    stringstrURI = Product.BaseProductUri + "/words/" + fileName + "/insertPageNumbers";
    strURI += "?storage=" + amazonS3StorageName + "&folder=" + amazonS3BucketName;
                    //sign URI
    stringsignedURI = Sign(strURI);
                    //get response stream
                    Stream responseStream = ProcessCommand(signedURI, "POST", strJSON, "json");
                    //build URI
    strURI = Product.BaseProductUri + "/words/" + fileName;
    strURI += "?format=" + saveFormat + "&storage=" + amazonS3StorageName + "&folder=" + amazonS3BucketName; ;
    
                    //sign URI
    signedURI = Sign(strURI);
                    //get response stream
    responseStream = ProcessCommand(signedURI, "GET");
    
    using (Stream fileStream = System.IO.File.OpenWrite(outputFile))
                    {
    CopyStream(responseStream, fileStream);
                    }
    responseStream.Close();
                }
    catch (Exception ex)
                {
    Console.WriteLine(ex.Message);
                }  
    public static string Sign(string url)
        {
    try
            {
    UriBuilder builder = new UriBuilder(url);
    if (builder.Query != null &&builder.Query.Length> 1)
    builder.Query = builder.Query.Substring(1) + "&appSID=" + SaasposeApp.AppSID;
    else
    builder.Query = "appSID=" + SaasposeApp.AppSID;
    builder.Path = builder.Path.TrimEnd('/');
    byte[] privateKey = System.Text.Encoding.UTF8.GetBytes(SaasposeApp.AppKey);
    
                System.Security.Cryptography.HMACSHA1 algorithm = new System.Security.Cryptography.HMACSHA1(privateKey);
    byte[] sequence = System.Text.ASCIIEncoding.ASCII.GetBytes(builder.Uri.AbsoluteUri);
    byte[] hash = algorithm.ComputeHash(sequence);
    string signature = Convert.ToBase64String(hash);
    signature = signature.TrimEnd('=');
    signature = System.Web.HttpUtility.UrlEncode(signature);
    signature = System.Text.RegularExpressions.Regex.Replace(signature, "%0-9a-f{2}", e =>e.Value.ToUpper());
    returnstring.Format("{0}&signature={1}", builder.Uri.AbsoluteUri, signature);
            }
    catch (Exception ex)
            {
    throw new Exception(ex.Message);
            }
        }
    
    public static Stream ProcessCommand(string strURI, string strHttpCommand)
        {
    try
            {
                Uri address = new Uri(strURI);
    System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(address);
    request.Method = strHttpCommand;
    request.ContentType = "application/json";
    
    request.ContentLength = 0;
    System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
    returnresponse.GetResponseStream();
            }
    catch (System.Net.WebExceptionwebex)
            {
    throw new Exception(webex.Message);
            }
    catch (Exception Ex)
            {
    throw new Exception(Ex.Message);
            }
        }
    
    public static Stream ProcessCommand(string strURI, string strHttpCommand, string strContent, string ContentType = "xml")
        {
    try
            {
    byte[] arr = System.Text.Encoding.UTF8.GetBytes(strContent);
    
                Uri address = new Uri(strURI);
    System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(address);
    request.Method = strHttpCommand;
    if (ContentType.ToLower() == "xml")
    request.ContentType = "application/xml";
    else
    request.ContentType = "application/json";
    
    request.ContentLength = arr.Length;
    
                Stream dataStream = request.GetRequestStream();
    dataStream.Write(arr, 0, arr.Length);
    dataStream.Close();
    
    System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
    returnresponse.GetResponseStream();
            }
    catch (System.Net.WebExceptionwebex)
            {
    throw new Exception(webex.Message);
            }
    catch (Exception Ex)
            {
    throw new Exception(Ex.Message);
            }
        }
    public static void CopyStream(Stream input, Stream output)
        {
    try
            {
    byte[] buffer = new byte[8 * 1024];
    intlen;
    while ((len = input.Read(buffer, 0, buffer.Length)) > 0)
                {
    output.Write(buffer, 0, len);
                }
            }
    catch (Exception ex)
            {
    throw new Exception(ex.Message);
            }
        }
    }
    
    public class Product
    {
    public static string BaseProductUri { get; set; }
    }
    public class SaasposeApp
    {
    public static string AppSID { get; set; }
    public static string AppKey { get; set; }
    }
    public class Field
    {
    public string Format { get; set; }
    public string Alignment { get; set; }
    publicboolIsTop { get; set; }
    publicboolSetPageNumberOnFirstPage { get; set; }
    }
    

  • Sort worksheet data of single or multiple columns in the Cloud
    Board » Django » Python Programming
    The latest version of Saaspose.Cells includes a remarkable feature for Sorting worksheet datausing Saaspose.Cells REST API. Using Saaspose.Cells, you can sort worksheet data in the cloud. This REST API allows you to sort the data of single or multiple columns in a single worksheet. You can choose to sort worksheet data in ascending or descending order as per your requirements.

    Saaspose.Cells makes data sorting a simple and hassle-free task and performs the function in a well-organized manner. It supports to ascend column data or descend column data of a worksheet in no time. This feature can be used in your application using any language of your choice and across any platform. You can utilize our SDK and REST examples to sort worksheet data in the cloud. It requires a simple step, download the required SDK from Github.com and incorporate the useful features into your application or more details, please refer to Saaspose.Cells documentation.

    Saaspose.Cells is a platform independent API and you can integrate it with other file format APIs to use a variety of features for your applications in the cloud. We offer a free development account for evaluation of the document properties features. You can sign up at Saaspose and get started with the feature rich APIs in no time. Feel free to write to us in case of any queries or feedback regarding Saaspose APIs.
  • Saaspose.Newsletter January 2013 Edition is Out Now!
    Board » Django » Python Programming
    Saaspose Newsletter for January 2013 has now been published that highlights all newly added information, exciting new features & informative blogs about Saaspose APIs & SDKs. This month Saaspose.Words, Saaspose.OCR & Saaspose.Cells have introduced new features for executing mail merge in documents, extracting text from remote image URL, splitting PDF files, encrypt & decrypt workbooks, split excel documents & manage annotations, Google cloud storage Integration with Saaspose APIs & many more.

    Tip of the Month: Integrate Google Cloud Storage with Saaspose APIs

    Your valuable feedback has always played a vital role in helping us improve our services. We have moved a step forward and are pleased to announce the integration of Google Cloud storage with Saaspose file format APIs. We have previously provided support for several storage options such as Windows Azure, Google Drive, Amazon S3 and Dropbox storage. Now you can integrate your Google Cloud account with Saaspose cloud APIs and get involved in a whole new experience of document manipulation. For quick and easy access to your data around the world, you just need to follow few simple steps of configuration and get started with document processing tasks in the cloud. Upload your documents on Google Cloud storage and enjoy a variety of document manipulation features for different file formats. Keep tuned in to our blog, and documentation. Click here to view more about Google cloud storage integration:

    Best of Saaspose API Blogs

    Stay tuned with the recent updates, features and announcements of Saaspose APIs through Saaspose Blog.

    1. Split PDF files using Saaspose.PDF REST API
    2. Manipulate images of different file formats using Saaspose File Format REST APIs
    3. Execute mail merge in your documents using Saaspose.Words API examples in PHP
    4. Extract Text From Remote Image URL using Saaspose.OCR REST API
    5. Append a list of documents using Saaspose.Words REST API

    Latest From the Documentation

    During the month of December 2012, we have added many examples for various features of Saaspose file format APIs in our documentation. These examples have been added in Saaspose.Words, Saapose.Cells and Saaspose.Pdf and Saaspose.Slides. You can utilize these examples in PHP and .NET to incorporate features in your applications such as execute mail merge, split MS Word documents, encrypt a workbook, merge multiple presentations, convert local PDF file to HTML etc. You may view a complete list of examples for each API in the following announcement posts:

    - - ]Saaspose.Cells REST API Documentation Changes Introduced During The Month Of December 2012
    - Saaspose.Pdf REST API Documentation Changes Introduced During the Month of December 2012


    Saaspose API SDK Updates

    During the month of December 2012, we have introduced new features in our SDKs for different programming languages like .NET, Ruby, Java and Python. There is a list of features available for each API on Github and you can download the required SDK. The new features are added in most of our APIs such as Saaspose.Words, Saaspose.Cells, Saaspose.Pdf etc. These features include convert workbooks, PDF files, MS Word documents to other file formats, encrypt workbook, extract text from local file, etc. For more details, you may refer to the following announcement

    Collect your copy of Saaspose December, 2013edition

    Collect the English version of this Newsletter:

    Keep in Touch

    There are several ways for you to keep in touch with us. The monthly newsletter is a way for us to keep in touch with you, but we are always interested in hearing from you.

    - Ask your question from Saaspose Team

    - Connect with us on Post a question on our Facebook
  • Merge Multiple Presentation Files & Download Merged Presentation
    Board » Django » Python Programming
    This technical tip allows developers to merge multiple presentation files using Saaspose.Slides REST API in your .NET applications. You can pass a list of all the files you want to merge using this example. Developers need to upload all the input files (Presentation1.pptx, Presentation2.pptx and Presentation3.pptx in case of this example) before running this example. Please check Upload File to Saaspose for how to. Some important steps for performing this task are to specify product URI, build URI, build URI to download merged presentation and Save output file.

    Sample Code for Merge multiple presentations

    SaasposeApp.AppKey = "89**********************";
    SaasposeApp.AppSID = "77***********************";
    //specify product URI
    Product.BaseProductUri = @"http://api.saaspose.com/v1.0";
    
    string[] presentationsList = new string[] { "Presentation2.pptx", "Presentation3.pptx" };
    PresentationsList list = new PresentationsList();
    list.PresentationPaths = presentationsList;
    
    string strJSON = JsonConvert.SerializeObject(list);
    
    //build URI
    string strURI = "http://api.saaspose.com/v1.0/slides/Presentation1.pptx/merge"; //Product.BaseProductUri + "/pdf/" + basePdf + "/appendDocument?appendFile=" + newPdf + "&startPage=1&endPage=" + iPageCount.ToString();
    string signedURI = Utils.Sign(strURI);
    
    Utils.ProcessCommand(signedURI, "POST", strJSON);
    
    // build URI to download merged presentation
    strURI = "http://api.saaspose.com/v1.0/storage/file/Presentation1.pptx";
    signedURI = Utils.Sign(strURI);
    
    using (Stream responseStream = Utils.ProcessCommand(signedURI, "GET"))
    {
        //Save output file
        using (Stream fileStream = System.IO.File.OpenWrite("C:\\MergedPresentation.pptx"))
        {
            Utils.CopyStream(responseStream, fileStream);
        }
    }
    
    //Following is the PresentationsList class
    
    /// <summary>
    /// represents list of presentations to be merged
    /// </summary>
    class PresentationsList
    {
        public PresentationsList() { }
    
        public string[] PresentationPaths { get; set; }
    }
    
    //build URI to upload file to Saaspose
                string strURI = "http://api.saaspose.com/v1.0/storage/file/MyRemoteFileName";
                string signedURI = Sign(strURI);
                UploadFileBinary(localfilepath, signedURI, "PUT");
    


  • Extract Image Text from Remote Image URL in Java Applications in Cloud
    Board » Django » Python Programming
    This technical tip allows developers to extract image text from remote image URL using Saaspose.OCR REST API in their Java applications. Some important steps for performing this task is to build URI to extract text, sign URI, execute signed URI request and get response, Parse and deserialize the JSON to an object and Display the value and type of all the extractedtext.

    Sample Code for forExtracting Image Text from Remote Image URL

    //build URI to extract text
    	    String strURI = "";
                strURI = "http://api.saaspose.com/v1.0/ocr/recognize?url=http://s017.radikal.ru/i406/1202/7b/70183bef7a09.jpg&language=english&useDefaultDictionaries=true";
    	    //sign URI
    	    String signedURI = Sign(strURI);
    	    //execute signed URI request and get response
    	    InputStreamresponseStream = ProcessCommand(signedURI, "POST");
    	    String strJSON = StreamToString(responseStream);
    	    // Parse and deserialize the JSON to a object.
    	OCRResponseocrResponse = gson.fromJson(strJSON, OCRResponse.class);
    
                // Display the value and type of all the recognized barcodes
                for (Part part : ocrResponse.getPartsInfo().getList())
                {
                    System.out.println("Text: " + part.getText());
                    System.out.println("Font Name: " + part.getFontName());
                    System.out.println("Font Size: " + part.getFontSize());
                    System.out.println("Bold: " + part.getBold());
                    System.out.println("Italic: " + part.getItalic());
                    System.out.println("Underline: " + part.getUnderline());
                }
    
    	    //Here is the OCRResponse class
    	public class OCRResponse extends BaseResponse 
    	    {
    	private String Text;
    		privateOCREnvelopPartsInfo;
    		public String getText() { return Text; }
    		publicOCREnvelopgetPartsInfo() { return PartsInfo; }
    	    }
    
    	    //Here is the OCREnvelop class
    	public class OCREnvelop 
    	    {
    		private List<Part> Parts;
    		public List<Part>getList() { return Parts; }
    	    }
    
      	    //Here is the Part class
    	public class Part 
    	    {
    	public Part() { }
    	private String FontName;
    	private float FontSize;
    	privateboolean Bold;
    	privateboolean Italic;
    	privateboolean Underline;
    	private String Text;
    	public String getFontName() { return FontName; }
    	public float getFontSize() { return FontSize; }
    	publicbooleangetBold() { return Bold; }
    	publicbooleangetItalic() { return Italic; }
    	publicbooleangetUnderline() { return Underline; }
    	public String getText() { return Text; }
    	    }
    

  • Protect Excel Workbooks from Unauthorized Access Using REST APIs
    Board » Django » Python Programming
    The latest version of Saaspose.Cells enhances the security measures by protecting the workbooks from unauthorized access to modify the structure or content. It allows to encrypt the workbook and assures the protection for making changes to the layout of the worksheets in a workbook. You can encrypt a workbook and assign an encryption key to prevent the unauthorized access by eavesdroppers or hackers. The encrypted workbooks cannot be accesses without decryption key.

    Saaspose.Cells allows you to decrypt workbook for authorized access to make any changes in the document. A decryption key is required to recover the contents of the workbook. The content, layout and structure of the decrypted workbook can then be modified. This is a powerful features supported by Saaspose.Cells that protects the workbooks from eavesdroppers and hackers and the use of encryption and decryption keys assures only authorized access to sensitive information. For more details, please refer to Saaspose.Cells documentation. All you need to do is download the required SDKs of Saaspose.Cells and enhance the productivity of your applications in the cloud. You can encrypt and decrypt workbooks easily using the feature rich Saaspose.Cells REST API.

    Saaspose.Cells is a platform independent REST API that allows document manipulation with several features and supports different programming languages. You can improve your document manipulation experience by collaborating Saaspose.Cells with other file format APIs and integrate multiple features in your application for better performance.
  • Convert & Execute Images in Word, PDF, PowerPoint & Excel Files in Cloud
    Board » Django » Python Programming
    Saaspose provides the platform to create, edit and manipulate your documents in the cloud. Using Saaspose APIs, you can integrate various features in your applications to manipulate your documents, presentations, worksheets, PDF files, image and barcode. While working with different file formats, you require to manipulate images within the documents in different scenarios. It can be image extraction, image replacement, conversion to images and various other functions depending on the requirements. Saaspose.Words, Saaspose.Cells, Saaspose.Pdf and Saapose.Slides have been designed to offer a wide range of features to utilize in your applications for image manipulations. Using Saapose.Words, you can get the images from document; you can either extract a single image or all images from the document. You can also convert drawing object to image and use the converted image as required. You can get the image drawing object from document using Saaspose.Words in your applications.

    Similarly using Saaspose.Slides, you can save a slide as an image with specified size and use it accordingly in your applications. You can get all the number of images in presentation or you may choose to get the number of images in a single slide. Saaspose.Slides allows you to get image count from a presentation or a slide uploaded at Amazon S3 storage. Using Saaspose.Pdf in your applications, you can convert a PDF page to image with default size. You can also extract a particular image from a PDF page with default size. Saaspose.Pdf allows you to replace the images in PDF file by using the uploaded image on Saaspose storage or send the image file as request stream to Saaspose API.

    Saaspose.Cells allows you to convert auto shapes in a workbook to images and save the images for further use. You can also convert single or multiple charts to images using Saaspose.Cells. You can choose a specific chart from a worksheet to be converted to an image. You can also convert pictures in a worksheet to images using Saaspose.Cells API and convert a worksheet to an image as well. This REST API allows you to convert ole object to image in the cloud. Being language independent, these APIs can be utilized in the applications using programming language of your choice such as .NET, Java, Ruby and PHP.
  • Extract Text from Remotely Stored Images & Recognizes Chars in Cloud
    Board » Django » Python Programming
    Saaspose development team is proud to announce the new release of Saaspose.OCR. This latest release of Saaspose.OCR allows users to perform text extraction from remote images. In document manipulation tasks, you may come across scenarios where you want to extract text from a remotely stored image. This eliminates the need of uploading the image to local server or external storage provider and performs text extraction.

    Saaspose.OCR allows you to extract remote text from remote image URL using this feature-rich API in your applications. Saaspose.OCR extracts text from remotely stored images and recognizes a collection of characters from the extracted text. It is a platform independent REST API that supports different programming languages for optical character recognition and text extraction from remote image URLs. You just need to have remote URLs of the images and let Saaspose.OCR perform the rest of tasks involved in optical character recognition. Formore details, please refer to Saaspose.OCR documentation. Saaspose.OCR API not only allows you to text extraction from remote image URL but you can also combine multiple REST APIs to enhance your application productivity.

    To get started with Saaspose.OCR, you only need to sign up at Saaspose and get application information. You can opt for free development account that enables you to evaluate all of our APIs.
  • Merge Multiple Presentations into single & Share It Across any Platform
    Board » Django » Python Programming
    Saaspose development team is proud to announce the merging of multiple presentationsusing Saaspose.Slides REST API using Saaspose.Slides REST API. Saaspose.Slides is a REST API which allows you to process presentations; create, modify, and convert presentations in the cloud. You can get formatting information of a slide, replace text, convert presentations to other file formats, or you may choose to manage your slides.

    You can merge multiple presentations into a single presentation using Saaspose.Slides REST API in your application. All you need to do is upload all the input files on Saaspose Storage and execute this feature. Once the files are merged, you can download the merged presentation file from Saaspose Storage. Saaspose provides the support for uploading presentations on other storage servers as well such as Amazon S3 and Dropbox and execute the “merge multiple presentations” feature on the uploaded files. You can directly merge the presentations on your local system using Saaspose.Slides REST API and SDKs without saving the file to Saaspose Storage. It is a single call process that uses merge presentations controller resource ; it uploads the files to server, merges multiple presentations into a single presentation, sends the merged file back as response stream and deletes the source files from the server.

    You can merge multiple presentations into a single presentation and share it across any platform. You can refer to our documentation that guides through the features and examples of Saaspose.Slides. To get started with Saaspose.Slides API, you only need to sign up at Saaspose and get application information. You can opt for free development account that enables you to evaluate all of our APIs.
  • Split Word Document into Multiple Docs within Different File Formats
    Board » Django » Python Programming
    Saaspose development team is very happy to announce the new release of Saaspose.Words. This release allows splittinglarge Word documents into separate documentsusing Saaspose.Words REST API.

    While working with your documents, you may come across scenarios where you want to split the large documents into smaller ones. You can split the documents into separate documents within the MS Word document or different file formats. Splitting one large document into smaller documents of different file formats is an important aspect in document manipulation tasks. It involves a series of steps that need to be performed for getting the desired results. Saaspose.Words eliminates the need of such complicated tasks and makes it hassle free. You can split your MS Word documents using Saaspose.Words REST API in your applications. Whether the size of your document is small or large, Saaspsose.Words splits hundreds of pages of a document into different documents. You may choose the file format while splitting the document such as PDF, image, MS Word documents, etc.

    Using this feature-rich API in your applications, you can split all pages of the document into new documents and maintain their file names as well. You can also choose to split specific pages to new documents from a single document. The formatting information and content of the document is maintained during the split process and the new files have the same formatting and style. You can directly split the documents on your local system using Saaspose.Words REST API and SDKs without saving the file to Saaspose Storage. It is a single call process that uses split document controller resource; it uploads the files to server, appends the files to the document, sends the converted file back as response stream and deletes the source files from the server.

    Saaspose.Words allows you to split apart MS Word documents into multiple documents with different file formats. You can divide and save pages of your MS Word documents into separate file uploaded at Amazon S3 storage. You need to upload the input document at Amazon S3 storage and execute the feature in your web or mobile applications. Saaspose.Words is a platform independent REST API and can be used with different programming languages such as .NET, Java, PHP and Ruby. You can utilize our SDK and REST examples to split MS Word documents in the cloud


Powered by Sphene Community Tools