Making a Document That Reads from a PDF

To make a document that reads from a PDF, all you need to do is state that you are reading from a PDF in the document’s body. The Logic API will automatically handle the rest. demo pdf

Step 1: Creating a document that summarizes lease agreements

As an example, let’s create a document that summarizes lease agreements. The document will read from a PDF file and summarize the key points of the lease agreement. We want the document to contain a summary of the costs, terms, and conditions of the lease agreement. The document will also include a list of the parties involved in the lease agreement. To start, let’s create a document with the following content:
From a PDF file of a lease agreement, create a summary.

Make a summary of the charges and monthly fees.

Make a list of any avoidable charges and inform the user of what they need to do to avoid having to pay any extra money.

Step 2: Testing this iteration of the document

Using the Preview button, we can test this document to see if it works as expected. The document will read from the PDF file and summarize the key points of the lease agreement. By testing this document with an example lease agreement PDF, we can see the output:
Output
        "output": {
        "avoidableCharges": [
          {
            "description": "Late Payment",
            "amount": 75,
            "avoidanceInstructions": "Pay your rent on or before the 1st of each month to avoid the $75 late fee."
          },
          {
            "description": "Dishonored Payment",
            "amount": 25,
            "avoidanceInstructions": "Ensure your payment method has sufficient funds and is correctly set up to prevent bounced checks or declined transactions."
          },
          {
            "description": "Key Replacement Charge",
            "amount": 25,
            "avoidanceInstructions": "Keep track of all issued keys and return them at move-out to avoid a $25 replacement fee."
          },
          {
            "description": "Smoke/CO Alarm Tampering Charge",
            "amount": 75,
            "avoidanceInstructions": "Do not tamper with or disable any smoke or CO alarms. Report any alarm issues to management for repair."
          },
          {
            "description": "Flea Spraying Charge",
            "amount": 35,
            "avoidanceInstructions": "Maintain pet and unit cleanliness and use preventative flea treatments to avoid this $35 service fee."
          },
          {
            "description": "Utilities (Late Setup)",
            "amount": 50,
            "avoidanceInstructions": "Set up all required utilities before the move-in date to avoid the $50 late-setup charge."
          },
          {
            "description": "Lease Buy-Out",
            "amount": 5580,
            "avoidanceInstructions": "Fulfill the full lease term (June 1, 2024 to June 30, 2025) rather than terminating early to avoid the $5,580 buy-out fee."
          }
        ],
        "contactInfo": {
          "phoneNumbers": [
            "(206) xxx-xxxx",
            "(916) xxx-xxxx",
            "(xxx) xxx-xxxx"
          ],
          "emailAddresses": null,
          "physicalAddresses": [
            "512 Ocean Ave, Santa Cruz, CA 95060",
            "760 Iron Road, Fowler, CA 93625"
          ],
          "availableHours": [
            "Tue-Fri 9:00am - 5:00pm",
            "Sat 10:00am - 4:00pm"
          ]
        },
        "chargesAndMonthlyFees": [
          {
            "description": "Vacancy Cost Recovery Fee",
            "amount": 50
          },
          {
            "description": "Utilities (Late Setup)",
            "amount": 50
          },
          {
            "description": "Flea Spraying Charge",
            "amount": 35
          },
          {
            "description": "Lease Buy-Out",
            "amount": 5580
          },
          {
            "description": "Key Replacement Charge",
            "amount": 25
          },
          {
            "description": "Late Payment",
            "amount": 75
          },
          {
            "description": "Dishonored Payment",
            "amount": 25
          },
          {
            "description": "Smoke/CO Alarm Tampering Charge",
            "amount": 75
          },
          {
            "description": "Base Rent",
            "amount": 2790
          },
          {
            "description": "Parking Rent",
            "amount": 45
          }
        ]
      },
The document is working as expected, but it still needs some tweaks. The Logic API was able to read the PDF file and create a summary of the charges and monthly fees, but the summary doesn’t include details like the resident’s name, the address of the housing, or the name of the owner of the property. The API did correctly summarize the avoidable charges, with cost.

Step 3: Improving the document

To improve the document, we can add more specific instructions to the document’s body. For example, we can specify that we want the document to include the cost of each item in the summary.
From a PDF file of a lease agreement, create a summary.

Start at the top with key details like the address of the housing, the name of the owner of the property, the name of the resident, and any other applicable details.

Make a summary of the charges and monthly fees and how much each of them are. Additionally, offer a simple explanation of what each fee is and what is means to the user.

Make a list of any avoidable charges and inform the user of what they need to do to avoid having to pay any extra money.

At the end of the summary, make sure to share all contact info available, whether this be phone numbers, email addresses, addresses and times they're available, etc.

Step 4: Testing this new iteration of the document

Using the Preview button, we can test this document to see if it works as expected. The document will read from the PDF file and summarize the key points of the lease agreement.
new output
"output": {
"keyDetails": {
"housingAddress": "512 Ocean Ave, Santa Cruz, CA 95060",
"ownerName": "512 Ocean Ave Partners LLC",
"residentName": "First Name Last Name",
"otherDetails": [
{
"label": "Residential Community",
"value": "The Brakes"
},
{
"label": "Unit Number",
"value": "A212"
},
{
"label": "Lease Start Date",
"value": "6/1/2024"
},
{
"label": "Lease End Date",
"value": "6/30/2025"
},
{
"label": "Lease Term Length",
"value": "1 year and 1 month"
},
{
"label": "Date Signed",
"value": "May 15, 2024"
}
]
},
"avoidableCharges": [
{
"description": "Late Payment Fee",
"amount": 75,
"avoidanceInstructions": "Pay rent by the 1st of each month to avoid the $75 late fee applied after the 4th."
},
{
"description": "Dishonored Payment Fee",
"amount": 25,
"avoidanceInstructions": "Ensure sufficient funds or use a reliable payment method to prevent bounced payments."
},
{
"description": "Smoke/CO Alarm Tampering Charge",
"amount": 75,
"avoidanceInstructions": "Do not tamper with smoke or carbon monoxide detectors to avoid this safety-related fee."
},
{
"description": "Key Replacement Charge",
"amount": 25,
"avoidanceInstructions": "Keep track of your keys and return all original keys at move-out to avoid replacement charges."
},
{
"description": "Utilities (Late Setup) Fee",
"amount": 50,
"avoidanceInstructions": "Contact utility providers and set up service before move-in to avoid late-setup fees."
},
{
"description": "Flea Spraying Charge",
"amount": 35,
"avoidanceInstructions": "Maintain cleanliness and pest control (treat pets as needed) to prevent flea infestations."
},
{
"description": "Lease Buy-Out Fee",
"amount": 5580,
"avoidanceInstructions": "Fulfill the full lease term or arrange a proper sublet per lease terms to avoid early termination fees."
},
{
"description": "Vacancy Cost Recovery Fee",
"amount": 50,
"avoidanceInstructions": "Complete the full lease term and give proper notice before moving out to avoid vacancy recovery fees."
}
],
"contactInfo": {
"phoneNumbers": [
"(206) xxx-xxxx",
"(916) xxx-xxxx"
],
"emailAddresses": null,
"physicalAddresses": [
"512 Ocean Ave, Santa Cruz, CA 95060",
"760 Iron Road, Fowler, CA 93625"
],
"availableHours": [
"Tue-Fri 9:00am - 5:00pm",
"Sat 10:00am - 4:00pm"
]
},
"chargesAndMonthlyFees": [
{
"description": "Vacancy Cost Recovery Fee",
"amount": 50,
"explanation": "Fee charged to recover costs when the unit is left vacant outside your lease term."
},
{
"description": "Utilities (Late Setup)",
"amount": 50,
"explanation": "One-time fee for late utility account setup if utilities aren’t active by move-in."
},
{
"description": "Flea Spraying Charge",
"amount": 35,
"explanation": "Cost for professional flea extermination if pests are found in the unit."
},
{
"description": "Lease Buy-Out",
"amount": 5580,
"explanation": "Fee required to terminate the lease early (prorated base rent)."
},
{
"description": "Key Replacement Charge",
"amount": 25,
"explanation": "Fee to replace lost or unreturned apartment keys."
},
{
"description": "Late Payment Fee",
"amount": 75,
"explanation": "Penalty for rent not paid by the due date (the 1st of the month)."
},
{
"description": "Dishonored Payment Fee",
"amount": 25,
"explanation": "Charge for returned or bounced rent payments."
},
{
"description": "Smoke/CO Alarm Tampering Charge",
"amount": 75,
"explanation": "Penalty for tampering with or disabling smoke or carbon monoxide detectors."
},
{
"description": "Base Rent",
"amount": 2790,
"explanation": "Monthly rental payment for the apartment unit."
},
{
"description": "Parking Rent",
"amount": 45,
"explanation": "Monthly fee for the assigned parking space."
},
{
"description": "Application Fee",
"amount": 124.04,
"explanation": "One-time processing fee for reviewing your rental application (already paid)."
}
]
}
In this new iteration of the document, the Logic API was able to read the PDF file and create a summary of the key points of the lease agreement. The document included the cost of each item in the summary, as well as a simple explanation of what each fee is and what it means to the user.

Conclusion

In summary, the Logic API makes it simple to read from a PDF file. By including an instruction in the document body indicating that a PDF should be read, the Logic API will automatically manage the required processing. You can correct and improve the document by adding more specific instructions to the document’s body. This will help the Logic API understand what you want it to do with the PDF file. Now, you can publish your document and begin using the API to read from PDF files.