Link Search Menu Expand Document

How to flatten specific fields in PDF

The Fill PDF Form API allows you to flatten certain editable fields or change them into read-only fields. To accomplish this, simply add ##flattenThisControl## to the end of the text.

For example, here’s a demonstration of how this works on two fields with different settings.

POST /v1/pdf/edit/add HTTP/1.1
Host: api.pdf.co
Content-Type: application/json
x-api-key: your_api_key
Content-Length: 498

{
    "name": "f1040-filled",
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
    "fields": [
        {
            
            "fieldName": "topmostSubform[0].Page1[0].f1_02[0]",
            "pages": "1", 
            "text": "John A. ##flattenThisControl##"
        },        
        {
            
            "fieldName": "topmostSubform[0].Page1[0].f1_03[0]",
            "pages": "1", 
            "text": "Doe"
        }
    ]
}

Zapier

If you want to flatten particular fields using Zapier, you can do so by opening your PDF.co PDF Filler action and copying the sample format provided below into the Fields Object fields.

Format pageIndex;fieldName;Text ##flattenThisControl##

Sample 0;editbox_name;This is a sample text ##flattenThisControl##

Make/Integromat

If you need to flatten certain fields in Integromat/Make, you can achieve this by taking the following steps:

  1. Open your PDF.co Fill a PDF Form module.
  2. Add an item under Fields.
  3. In the Text field, enter the value of the text field you want to flatten, followed by ##flattenThisControl##. For instance, you could input This is an example text ##flattenThisControl##.