Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Gist contains code snippets related to PDF concatenation using Python SDK
# Get your ClientId and ClientSecret from https://dashboard.aspose.cloud (free registration required).
#initialize PdfApi client instance using ClientID and ClientSecret
pdf_api_client = asposepdfcloud.api_client.ApiClient("d87269aade6a46cdc295b711e26809af", "a41d01ef-dfd5-4e02-ad29-bd85fe41e3e4")
# create PdfApi instance while passing PdfApiClient as argument
pdf_api = PdfApi(pdf_api_client)
# Source PDF document
file_name = 'PdfWithAnnotations.pdf'
# PDF file whose pages need to be appended
append_file_name = 'PdfWithTable.pdf'
# create options instance defining concatenation PDF
# start and end page of concatenating file
opts = {
"append_file": append_file_name,
"start_page": 1,
"end_page": 2
}
# Call API to merge the pages
response = pdf_api.post_append_document(file_name, **opts)
# render response code in console
print(response)
This Gist contains code snippets related PDF merge using Python SDK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment