New Release of Aspose.PDF Cloud SDK for Python – A Complete Solution to Manipulate PDF Portable Document Format in Python Using Powerful Aspose.PDF Cloud APIs

Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.PDF Cloud

Aspose.PDF CloudAspose.PDF Cloud’s platform independent document manipulation API is a true REST API that can be used with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more. You can use it with any platform — web, desktop, mobile, and cloud.

With Aspose.PDF Cloud you can work with all aspects of PDF (portable document format) file: read, write, convert, split, merge and many more options to manipulate PDF documents. Aspose.PDF Cloud is a complete solution for performing any manipulation you can wish to perform on PDF files in the cloud. Learn More

What’s new in the latest release

This is a major revamp release for Aspose.PDF Cloud SDK for Python. It covers all the Aspose.PDF Cloud APIs. This SDK provides a complete solution to manipulate PDF (Portable Document Format) in Python using powerful Aspose.PDF Cloud APIs, so you can perform any operation on PDF files in the cloud seamlessly.

Source Code Repository

Complete source code of this release of Aspose.PDF Cloud SDK for Python is freely available on your favorite GitHub and Codeplex repositories.

Setup

Aspose.PDF Cloud SDK for Python is also available as released package in the PyPI (Python Package Index). You can bypass source code repository and depend directly on the released package by installing from PyPI:

PyPI Aspose.PDF Cloud SDK for Python Installation


pip install asposepdfcloud
OR
easy_install asposepdfcloud

Data

In order to manipulate any files, you first need to upload them to the Aspose cloud storage or 3th party cloud storage using Aspose.Storage Cloud SDK for Python.

Quick SDK Tutorial


import asposepdfcloud
from asposepdfcloud.PDFApi import PDFApi
from asposepdfcloud.PDFApi import ApiException
from asposepdfcloud.models import AppendDocument

import asposestoragecloud 
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage

apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #sepcify App SID
apiServer = "http://api.aspose.com/v1.1"
data_folder = "../../data/"

#Instantiate Aspose Storage API SDK
storage_apiClient = asposestoragecloud.ApiClient.ApiClient(apiKey, appSid, True)
storageApi = StorageApi(storage_apiClient)
#Instantiate Aspose PDF API SDK
api_client = asposepdfcloud.ApiClient.ApiClient(apiKey, appSid, True)
pdfApi = PDFApi(api_client);

#set input file name
name = "Sample.pdf"
startPage = 2
endPage = 3

appendFileName = "sample-input.pdf"

body = AppendDocument.AppendDocument()
body.Document = appendFileName
body.StartPage = startPage
body.EndPage = endPage

try:
    #upload files to aspose cloud storage
    response = storageApi.PutCreate(name,'../../data/' + name)
    response = storageApi.PutCreate(appendFileName,'../../data/' + appendFileName)

    #invoke Aspose.PDF Cloud SDK API to append multiple PDF files
    response = pdfApi.PostAppendDocument(name, body, startPage=startPage, endPage=endPage)

    if response.Status == "OK":
        #download appended pdf from aspose cloud storage
        response = storageApi.GetDownload(Path=name)
        outfilename = "c:/temp/" + name
        with open(outfilename, 'wb') as f:
                    for chunk in response.InputStream:
                        f.write(chunk)

except ApiException as ex:
            print "ApiException:"
            print "Code:" + str(ex.code)
            print "Message:" + ex.message    

Aspose.PDF Cloud API Documentation

Aspose.PDF Cloud Documentation is available to guide developers to get familiar with the specific resources and operations within the Aspose.PDF Cloud REST API.

Aspose.PDF Cloud SDK for Python Examples

Aspose.PDF Cloud SDK for Python Examples are also available to guide developers to get familiar with SDK and its usage to invoke resources and operations using the Aspose.PDF Cloud REST API. Please see the SDK examples of following categories.

Start a Free Trial Today

Start a free trial today – all you need is to sign up with the Aspose Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by Aspose Cloud.