In this tutorial, we will show you how to use the Bubble API Connector to translate an English PDF Invoice to German.

  1. Open My Templates
  2. Create New Template
  3. Open New Template
  4. Start with a Blank Page
  5. Add Elements
  6. Add Plugin
  7. Install API Connector
  8. Add API
  9. Set up API Connector
  10. Add Parameters
  11. Initialize Call Result
  12. Add Event
  13. Add Action
  14. Map Dynamic Values
  15. Set Destination
  16. Preview
  17. Fill Form
  18. Translated PDF Output

Step 1 – Open My Templates

To begin, open to the My templates tab and click on the New Template button.

Open My Templates

Step 2 – Create New Template

Fill out the template creation form and click on Create template.

Create New Template

Step 3 – Open New Template

Now, click on the Edit icon to open the template.

Edit Template

Step 4 – Start with a Blank Page

Click on the Start with a blank page button and close the assistant.

Start with a Blank Page

Step 5 – Add Elements

Let’s add four input elements for the Source File, From Language, To Language, Async and a button to submit the request.

Add Form Elements

Step 6 – Add Plugin

Let’s go to the Plugins tab and add a plugin.

Add Plugin

Step 7 – Install API Connector

Look up the API Connector and click on the Install button.

Install API Connector

Step 8 – Add API

Once the API Connector is installed, click on the Add another API button.

Add API

Step 9 – Set up API Connector

Let’s configure the API Connector.

  • In the API Name field, type in PDF.co PDF Translate.
  • In the Name field, enter PDF Translate.
  • In the Use as dropdown box, select the Action option.
  • In the Data type dropdown box, leave it to the default JSON or choose your preferred Data type.
  • Select POST and enter the PDF.co PDF Translate API endpoint https://api.pdf.co/v1/pdf/translate. You can find more information about the API here.
  • Under Headers, add x-api-key as the Key with your PDF.co API Key as the Value. You can get your API Key here.
  • Also under Headers, add accept as the Key and application/json as the Value.

Setup API Connector

Step 10 – Add Parameters

Let’s add the PDF.co PDF Translate parameters.

  • In the first Key field, enter the url parameter, the Value https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-csv/sample.pdf  and tick off the Queryst check box.
  • In the second Key field, type in the langFrom parameter, the value en, and tiff off the Queryst check box.
  • In the third Key field, enter the langto parameter, the value de, and tiff off the Queryst check box.
  • In the fourth Key field, type in the async parameter, the value false, and tiff off the Queryst check box.
  • Add a checkmark to the Capture response headers check box and click on the Initialize call button.

Add PDF.co Parameters

PLEASE NOTE:The PDF Translate API only translates the first page by default. To translate a PDF document with 2 or more pages, please add the pages parameter.

Step 11 – Initialize Call Result

When the API Connector is set up correctly, PDF.co PDF Translate will return the sample values below.

PDF.co API Call Result

Step 12 – Add Event

Now, go to the Workflow tab and click on the box to add an event. Select the Elements, and An element is clicked options.

Add Event

Step 13 – Add Action

Click on the add an action button and choose the PDF.co PDF Translate – PDF Translate plugin.

Add Action

Step 14 – Map Dynamic Values

Let’s map the Input elements’ dynamic values with the PDF Translate parameters.

  • In the url field, select the Input PDF URL’s value.
  • In the langFrom field, select the Input From Language’s value.
  • In the langto field, select the Input To Language’s value.
  • In the async field, select the Input Async’s value.

Map Dynamic Values

Step 15 – Set Destination

Now, select the Open an external website in the next step and choose the PDF Translate’s body url result in the Destination field.

Set Destination

Step 16 – Preview

Click on the Preview button.

Preview Website

Step 17 – Fill Form

Enter the sample PDF link, en for English, de for German, and false for async. Then, click on the Translate button.

Fill Form

PLEASE NOTE:The async parameter allows you to process large files in the background. Set this parameter to True when your document takes more than 30 seconds to process.

Step 18 – Translated PDF Output

Here’s the translated PDF fom our sample PDF.

PDF Translated From English To German
PDF Translated from English to German

In this tutorial, you learned how to translate a PDF. You learned how to set up the API Connector to use the PDF.co PDF Translate API in Bubble. You also learned how to configure the Workflow to get dynamic values for translating PDF.