Skip to content
Features

Export PDF Report

This document provides a comprehensive overview of the essential steps for creating and customizing PDF reports, setting up report generation, handling webhooks, and managing completed reports.

The PDF API allows you to generate detailed and customizable PDF reports of scan results, including plagiarism checks, AI detection, and writing assistant feedback. These reports can be branded with your own logo and customized to match your organization’s needs.

The PDF generation process is integrated with the Copyleaks scanning process, where you enable PDF creation during scan submission and then receive the generated PDF through webhooks.

Copyleaks API also offers different PDF report versions, with version 3 being the latest and most feature-rich option that includes advanced formatting and comprehensive analysis visualization.

Before you start using the PDF API, ensure you have the following:

  1. An active Copyleaks account: If you don’t have one, sign up here.
  2. Familiarity with RESTful API principles: Basic knowledge of HTTP requests and responses.
  3. A tool for HTTP requests: Use tools like cURL, Postman, or Copyleaks’ SDK.
Run In Postman

To enable PDF report generation, we first need to generate an access token. We will use the login endpoint.

The API key can be found on the Copyleaks API Dashboard.

Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the Authorization: Bearer <TOKEN> header.

This token remains valid for 48 hours.

POST https://id.copyleaks.com/v3/account/login/api
Content-Type: application/json
{
"email": "<EMAIL_ADDRESS>",
"key": "<API_KEY>"
}

Use the submit file endpoint to send content for analysis while enabling PDF report generation. The key difference for PDF reports is including the properties.pdf.create parameter set to true.

In the URL, supply your chosen scan ID, which serves as the identifier for the scan. Each scan needs to have a unique scan ID.

The properties.pdf.version should be set to 3 to use the latest PDF report format with enhanced visuals and comprehensive data visualization.

The properties.pdf.title allows you to customize the title that appears on the PDF report.

For branding purposes, you can include your organization’s logo using properties.pdf.largeLogo (PNG format, base64 encoded, max 100kb, recommended size 185x50px).

PUT https://api.copyleaks.com/v3/scans/submit/file/<SCAN_ID>
Authorization: Bearer <your_token>
Content-Type: application/json
{
"base64": "<base64_encoded_file_content>",
"filename": "<FILE_NAME>",
"properties": {
"webhook": "https://your.server/webhook?event={\{STATUS\}}",
"sandbox": true,
"pdf": {
"create": true,
"version": 3,
"title": "Custom PDF Report Title",
"customLogo": "<base64_encoded_logo>"
}
}
}

The PDF report can be extensively customized to match your organization’s branding and requirements.

PropertyTypeDescriptionDefault
createbooleanAdd a request to generate a customizable export of the scan report, in a pdf format. Set to true in order to generate a pdf report for this scan.false
titlestringCustomize the title for the PDF report. Maximum 256 characters.null
colorsobjectObject containing color customization options for the PDF report.-
largeLogostring (base64)Customize the logo image in the PDF report. Only supports png format. Max file size: 100kb. Recommended size: width 185px, height 50px.null
rtlbooleanWhen set to true, the text in the report will be aligned from right to left.false
versionintegerPDF version to generate. By default version 1 will be generated as it is the current stable version. Version 3 is the latest iteration of the PDF report. Available values: 1, 2, 3 (Beta)1

The scan and PDF report generation may take seconds to minutes, depending on the content, features used, and products enabled.

Once the scan is complete successfully, Copyleaks API will send a completed webhook to the URL you supplied in the submit under properties.webhooks.status. At the same time, the {STATUS} is replaced with “completed”.

The completed webhooks hold the summary information about the scan, such as the number of matched words, total words, and results found.

If the scan finishes with an error, an error webhook will be sent to the properties.webhooks.status while the {STATUS} is replaced with error.

Use the export method to retrieve the generated PDF report along with other scan artifacts. The export method sends webhooks with each artifact’s content to your specified target server.

We supply the Scan ID we used earlier in the submit endpoint in the URL. The user chooses a unique Export ID for each export.

For PDF reports specifically, we add a pdf section to the export request, providing an endpoint where the PDF should be sent when ready.

POST https://api.copyleaks.com/v3/downloads/<SCAN_ID>/export/<EXPORT_ID>
Authorization: Bearer <API_TOKEN>
Content-Type: application/json
{
"completionWebhook": "https://your.server/webhook/export/completion",
"pdf": {
"endpoint": "https://your.server/webhook/export/pdf",
"verb": "POST",
"headers": {
"key": "value",
"key2": "value2"
}
}
}

Should you require any assistance or have inquiries, please contact Copyleaks Support or ask a question on StackOverflow with the copyleaks-api tag. We appreciate your interest in Copyleaks and look forward to supporting your efforts to maintain originality and integrity.