GroupDocs.Merger offers a Free Trial and a 30-day Temporary License for evaluation, along with several purchase plans. If you want to dive straight into the code, the Free Trial is fully functional (see the limitations below) and does not require any setup.
Note
Please note that general policies and practices guide you on evaluating, licensing, and purchasing our products. See the Purchase Policies and FAQ section for details.
Free Trial or Temporary License
You can try GroupDocs.Merger without purchasing a license.
Free Trial
The evaluation version is identical to the full version — it simply becomes fully licensed when you apply a license. Instructions for setting a license are provided in the following sections.
The evaluation version has the following limitations:
Only the first three pages of a document are processed: a result holds at most three pages, a split writes at most three parts, previews stop at page 3, and get_document_info reports at most three pages.
Results carry the notice “Created with evaluation version of GroupDocs.Merger”: on every page of a PDF and every slide of a presentation, at the start of a Word document, and on an extra “Evaluation Warning” worksheet in a spreadsheet.
Temporary License
If you’d like to test GroupDocs.Merger without the limitations of the trial version, you can request a 30-day Temporary License. For more information, see the Get a Temporary License page.
Once you’ve obtained a license, follow these instructions to set it up.
A license should be set:
Only once per application, and
Before using any other GroupDocs.Merger classes.
Tip
Though the license can be set multiple times per application, it is recommended to set it only once, as repeated calls to the set_license method will use unnecessary processing time.
Set Environment Variable
You can set the GROUPDOCS_LIC_PATH environment variable to the absolute path of the license file. GroupDocs.Merger will then read this value and apply the license.
The license is applied at the first Merger call, not when the package is imported, so a variable set after the import still counts. GROUPDOCS_LIC_PATH can also hold the URL of a license file. A license file is never picked up by its location alone: a GroupDocs.Merger.lic in the folder the application runs from is not applied unless the variable or set_license names it.
A license that cannot be applied (a missing file, an expired subscription, a license for another product) raises LicenseError from the first Merger call on, instead of letting the process run in evaluation mode unnoticed. The message names the variable, the source and the reason. Applying a license with License().set_license(...) ends the refusal. Set GROUPDOCS_LIC_STRICT=0 to get one LicenseWarning and evaluation mode instead. When GROUPDOCS_LIC_PATH is not set, ASPOSE_LIC_PATH is read instead.
fromgroupdocs.mergerimportLicenseError,Mergertry:withMerger("report.docx")asmerger:merger.join("appendix.docx")merger.save("combined.docx")exceptLicenseErroraserror:# GROUPDOCS_LIC_PATH=... could not be applied: <the reason>print(error)
Set License from a File
The following code demonstrates setting a license from a file:
importosfromgroupdocs.mergerimportLicensedefset_license_from_file():# Get absolute path to license filelicense_path=os.path.abspath("./GroupDocs.Merger.lic")# Check if license file existsifnotos.path.exists(license_path):print(f"License file not found at: {license_path}")return# Instantiate License and set the licenselicense=License()license.set_license(license_path)if__name__=="__main__":set_license_from_file()
Set License from a Stream
This example shows how to set a license from a stream:
importosfromgroupdocs.mergerimportLicensedefset_license_from_stream():# Get absolute path to license filelicense_path=os.path.abspath("./GroupDocs.Merger.lic")# Check if license file existsifnotos.path.exists(license_path):print(f"License file not found at: {license_path}")return# Create a readable streamwithopen(license_path,"rb")aslicense_stream:# Instantiate License and set the licenselicense=License()license.set_license(license_stream)if__name__=="__main__":set_license_from_stream()
Set Metered License
A Metered License is also available as an alternative to a traditional license file. It is a usage-based licensing model that may be more suitable for customers who prefer to be billed based on actual API feature usage.
The following sample demonstrates how to use metered licensing:
fromgroupdocs.mergerimportMetereddefset_metered_license():# Set your public and private keyspublic_key="******"private_key="******"# Check if keys are setifnotpublic_keyorpublic_key=="******"ornotprivate_keyorprivate_key=="******":print("Please set your public and private keys")return# Instantiate Metered and set keysmetered=Metered()metered.set_metered_key(public_key,private_key)# Get the amount of data processedquantity=metered.get_consumption_quantity()print("Quantity consumed: ",quantity)# Get the number of credits usedcredits_used=metered.get_consumption_credit()print("Credits used: ",credits_used)if__name__=="__main__":set_metered_license()
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Ask AI
Ask anything about this page — the answer is based on its content.
Searching the docs and writing an answer…
Something went wrong while getting an answer. Please try again in a moment.