Cloud REST API to join, swap, trim, split or move documents, spreadsheets, presentations, PDF and OpenDocument file formats within Python applications.
Start Free TrialGroupDocs.Merger Cloud SDK for Python is a flexible document merging and splitting solution for a bunch of popular document formats including Microsoft Office Word, Excel, PowerPoint, Visio, OneNote, PDF, HTML, OpenDocument, text and many others. The Merger API provides a convenient solution to combine two or more documents into a single document or split up one source document into multiple resultant documents. You can also preview the document pages as images for the whole document or choosing the preferred page range according to the customized document previewing requirements. The SDK also support performing document operations to shift, delete, exchange, rotate or change the page orientation either as portrait or landscape for whole or preferred range of pages.
//Get your App SID and App Key at https://dashboard.groupdocs.cloud (free registration is required).
class PreviewDocument:
@classmethod
def Run(cls):
documentApi = groupdocs_merger_cloud.DocumentApi.from_keys(Common.app_sid, Common.app_key)
options = groupdocs_merger_cloud.PreviewOptions()
options.file_info = groupdocs_merger_cloud.FileInfo("WordProcessing/four-pages.docx")
options.output_path = "Output/preview-page"
options.pages = [1, 3]
options.format = "Png"
result = documentApi.preview(groupdocs_merger_cloud.PreviewRequest(options))
print("Documents count = " + str(len(result.documents)))
```