Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active November 24, 2021 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/19ff2c1bccf9a1df1d3bc7249fc006a1 to your computer and use it in GitHub Desktop.
Save aspose-cloud/19ff2c1bccf9a1df1d3bc7249fc006a1 to your computer and use it in GitHub Desktop.
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