Picture 21
122 ETL Load Automatic creation of PDF documents
10 June 2025
Picture 23
124 ETL Load Reporting and loading to other systems
10 June 2025

123 ETL Load automatic document generation from FPDF

Automating reporting at the ETL stage Load is an important step in data processing, especially when the results of the analysis need to be presented in a format that is easy to communicate and understand. In the construction industry, this is often relevant for progress reports, project data statistics, quality assurance reports or financial documentation.

One of the most convenient tools for such tasks is the open source library, FPDF, available for both Python and PHP.

The FPDF open source library provides a flexible way to generate documents through code, allowing you to add headers, text, tables and images. Using code instead of manual editing reduces errors and speeds up the process of preparing reports in PDF format.

One of the key stages of creating a PDF -document is adding headings and main text in the form of comments or description. However, when creating a report, it is important not only to add text, but also to structure it properly. Headings, indents, line spacing – all this affects the readability of the document. Using FPDF, you can set formatting parameters, control the arrangement of elements and customize the style of the document.

FPDF is very similar in principle to HTML. Those who are already familiar with HTML can easily generate PDF documents of any complexity using FPDF, as the code structure is very similar to HTML markup: headers, text, images and tables are added in a similar way. Those who are not familiar with HTML need not worry – you can use LLM, which will instantly help you compose the code to generate the desired document layout.

  • The following example demonstrates how to generate a report with a header and body text. Executing this code in any IDE with Python support creates a PDF -file containing the desired header and text:

    from fpdf import FPDF    # Import the FPDF library
    pdf = FPDF() # Create PDF -document
    pdf.add_page() # Add a page

    pdf.set_font(“Arial”, style=’B’, size=16) # Set font: Arial, bold, size 16
    pdf.cell(200, 10, “Project Report“, ln=True, align=’C’) # Create title and center it
    pdf.set_font(“Arial”, size=12) # Change the font to regular Arial, size 12
    pdf.multi_cell(0, 10, This document contains data on the results of project file verification“) # Add multi-line text
    pdf.output(r “C:\reports\report.pdf”) # Save PDF -file

Рисунок 1
Fig. 7.2-14 With a few lines of Python code, we can automatically generate the PDF text document we need.

When preparing reports, it is important to take into account that the data from which the document is formed is rarely static. Headers, text blocks (Fig. 7.2-14) are often formed dynamically, receiving values at the Transform stage in the ETL process.

Using the code allows you to create documents that contain up-to-date information: project name, date of report generation, as well as information about participants or current status. The use of variables in the code allows you to automatically insert this data in the required places in the report, completely eliminating the need for manual editing before sending.

In addition to simple text and headings, tables occupy a special place in project documentation. Almost every document contains structured data: from object descriptions to inspection results. Automatic generation of tables based on data from the Transform stage allows not only to speed up the process of document preparation, but also to minimize errors when transferring information. FPDF allows to insert tables into PDF -files (as text or pictures), setting cell borders, column sizes and fonts (Fig. 7.2-15). It is especially convenient when working with dynamic data, when the number of rows and columns can vary depending on the document tasks.

  • The following example shows how to automate the creation of tables, e.g. with a list of materials, estimates or parameter test results:

    data = [
    [“Item“, “Quantity“, “Price“], # Column headings
    [“Concrete“, “10 “, “$ 500.”], # First row data
    [“Rebar“, “2 tons“, “$ 600”], # Second row data.
    [“Brick,” “5,000 pieces,” “$ 750.”], # Line 3 data.
    ]

    pdf = FPDF () # Create PDF -document
    pdf.add_page() # Add a page
    pdf.set_font(“Arial”, size=12) # Set the font

    for row in data: # Search table rows
    for item in row: # Go through the cells in the row
    pdf.cell(60, 10, item, border=1) # Create a cell with a border, width 60 and height 10.
    pdf.ln() # Move to the next line
    pdf.output(r “C:\reports\table.pdf”) # Save PDF -file

Рисунок 1
Fig. 7.2-15 You can automatically generate not only text, but also any table information obtained in the Transform step.

In real reporting scenarios, tables are usually dynamically generated information obtained at the data transformation stage. In the example shown (Fig. 7.2-15), the table is inserted into the PDF -document in a static form: the data for the example was placed in the data dictionary (the first line of the code), in real conditions such data variable is filled in automatically after e.g. grouping of the dataframe.

In practice, such tables are often built on the basis of structured data coming from various dynamic sources: databases, Excel -files, API -interfaces or results of analytical calculations. Most often, at the Transform (ETL) stage, data is aggregated, grouped or filtered – and only then transformed into totals in the form of graphs or two-dimensional tables displayed in reports. This means that the table content can change depending on the selected parameters, analysis period, project filters or user settings.

The use of dynamic dataframes and datasets in the Transform stage makes the reporting process in the Load stage as flexible, scalable and easily repeatable as possible without the need for manual intervention.

Besides tables and text FPDF also supports adding graphs of tabular data, which allows you to embed images generated with Matplotlib or other visualization libraries we have considered above into the report. You can supplement the document with any graphs, charts and diagrams using the code.

  • Using the Python library FPDF, let’s add a graph pre-generated with Matplotlib. to the PDF document:

    import matplotlib.pyplot as plt # Import Matplotlib to create plots

    fig, ax = plt.subplots() # Create the Fig. and axes of the chart
    categories = [“Concrete“, “Rebar“, “Brick“] # Category names
    values = [50000, 60000, 75000] # Category values
    ax.bar(categories, values) # Create a bar chart
    plt.ylabel(“Value,$.”) # Sign the Y axis
    plt.title(“Cost Distribution”) # Add a title
    plt.savefig(r “C:\reports\chart\chart\chart.png”) # Save the chart as an image.

    pdf = FPDF () # Create PDF -document
    pdf.add_page() # Add a page
    pdf.set_font(“Arial”, size=12) # Set the font
    pdf.cell(200, 10, “Cost Chart“, ln=True, align=’C’) # Add a header

    pdf.image(r “C:\reports\chart\chart\chart.png”, x=10, y=30, w=100) # Insert image into PDF (x, y – coordinates, w – width)
    pdf.output(r “C:\reports\chart_report.pdf”) # Save PDF file

Рисунок 1
Fig. 7.2-16 With a dozen lines of code, you can generate a graph, save it, and then paste it into a PDF document.

FPDF makes the process of document preparation and logic transparent, fast and convenient. Templates built into the code allow generating documents with up-to-date data, eliminating the need for manual filling.

Using ETL automation instead of time-consuming manual reporting, professionals can focus on analyzing data and making decisions, rather than choosing the right tool to work with a particular data silo with a clear user interface.

Thus, the FPDF library provides a flexible tool for automated creation of documents of any complexity – from short technical reports to complex analytical summaries with tables and charts, which allows not only to speed up the document flow, but also significantly reduce the probability of errors associated with manual data entry and formatting.

.

Leave a Reply

Change language

Post's Highlights

Stay updated: news and insights



We’re Here to Help

Fresh solutions are released through our social channels

UNLOCK THE POWER OF DATA
 IN CONSTRUCTION

Dive into the world of data-driven construction with this accessible guide, perfect for professionals and novices alike.
From the basics of data management to cutting-edge trends in digital transformation, this book
will be your comprehensive guide to using data in the construction industry.

Related posts 

Focus Areas

navigate
  • ALL THE CHAPTERS IN THIS PART
  • A PRACTICAL GUIDE TO IMPLEMENTING A DATA-DRIVEN APPROACH (8)
  • CLASSIFICATION AND INTEGRATION: A COMMON LANGUAGE FOR CONSTRUCTION DATA (8)
  • DATA FLOW WITHOUT MANUAL EFFORT: WHY ETL (8)
  • DATA INFRASTRUCTURE: FROM STORAGE FORMATS TO DIGITAL REPOSITORIES (8)
  • DATA UNIFICATION AND STRUCTURING (7)
  • SYSTEMATIZATION OF REQUIREMENTS AND VALIDATION OF INFORMATION (7)
  • COST CALCULATIONS AND ESTIMATES FOR CONSTRUCTION PROJECTS (6)
  • EMERGENCE OF BIM-CONCEPTS IN THE CONSTRUCTION INDUSTRY (6)
  • MACHINE LEARNING AND PREDICTIONS (6)
  • BIG DATA AND ITS ANALYSIS (5)
  • DATA ANALYTICS AND DATA-DRIVEN DECISION-MAKING (5)
  • DATA CONVERSION INTO A STRUCTURED FORM (5)
  • DESIGN PARAMETERIZATION AND USE OF LLM FOR CAD OPERATION (5)
  • GEOMETRY IN CONSTRUCTION: FROM LINES TO CUBIC METERS (5)
  • LLM AND THEIR ROLE IN DATA PROCESSING AND BUSINESS PROCESSES (5)
  • ORCHESTRATION OF ETL AND WORKFLOWS: PRACTICAL SOLUTIONS (5)
  • SURVIVAL STRATEGIES: BUILDING COMPETITIVE ADVANTAGE (5)
  • 4D-6D and Calculation of Carbon Dioxide Emissions (4)
  • CONSTRUCTION ERP AND PMIS SYSTEMS (4)
  • COST AND SCHEDULE FORECASTING USING MACHINE LEARNING (4)
  • DATA WAREHOUSE MANAGEMENT AND CHAOS PREVENTION (4)
  • EVOLUTION OF DATA USE IN THE CONSTRUCTION INDUSTRY (4)
  • IDE WITH LLM SUPPORT AND FUTURE PROGRAMMING CHANGES (4)
  • QUANTITY TAKE-OFF AND AUTOMATIC CREATION OF ESTIMATES AND SCHEDULES (4)
  • THE DIGITAL REVOLUTION AND THE EXPLOSION OF DATA (4)
  • Uncategorized (4)
  • CLOSED PROJECT FORMATS AND INTEROPERABILITY ISSUES (3)
  • MANAGEMENT SYSTEMS IN CONSTRUCTION (3)
  • AUTOMATIC ETL CONVEYOR (PIPELINE) (2)

Search

Search

057 Speed of decision making depends on data quality

Today’s design data architecture is undergoing fundamental changes. The industry is moving away from bulky, isolated models and closed formats towards more flexible, machine-readable structures focused on analytics, integration and process automation. However, the transition...

060 A common language of construction the role of classifiers in digital transformation

In the context of digitalization and automation of inspection and processing processes, a special role is played by classification systems elements – a kind of “digital dictionaries” that ensure uniformity in the description and parameterization...

061 Masterformat, OmniClass, Uniclass and CoClass the evolution of classification systems

Historically, construction element and work classifiers have evolved in three generations, each reflecting the level of available technology and the current needs of the industry in a particular time period (Fig. 4.2-8): First generation (early...

Don't miss the new solutions

 

 

Linux

macOS

Looking for the Linux or MAC version? Send us a quick message using the button below, and we’ll guide you through the process!


📥 Download OnePager

Welcome to DataDrivenConstruction—where data meets innovation in the construction industry. Our One-Pager offers a concise overview of how our data-driven solutions can transform your projects, enhance efficiency, and drive sustainable growth. 

🚀 Welcome to the future of data in construction!

You're taking your first step into the world of open data, working with normalized, structured data—the foundation of data analytics and modern automation tools.

By downloading, you agree to the DataDrivenConstruction terms of use 

Stay ahead with the latest updates on converters, tools, AI, LLM
and data analytics in construction — Subscribe now!

🚀 Welcome to the future of data in construction!

You're taking your first step into the world of open data, working with normalized, structured data—the foundation of data analytics and modern automation tools.

By downloading, you agree to the DataDrivenConstruction terms of use 

Stay ahead with the latest updates on converters, tools, AI, LLM
and data analytics in construction — Subscribe now!

🚀 Welcome to the future of data in construction!

You're taking your first step into the world of open data, working with normalized, structured data—the foundation of data analytics and modern automation tools.

By downloading, you agree to the DataDrivenConstruction terms of use 

Stay ahead with the latest updates on converters, tools, AI, LLM
and data analytics in construction — Subscribe now!

🚀 Welcome to the future of data in construction!

You're taking your first step into the world of open data, working with normalized, structured data—the foundation of data analytics and modern automation tools.

By downloading, you agree to the DataDrivenConstruction terms of use 

Stay ahead with the latest updates on converters, tools, AI, LLM
and data analytics in construction — Subscribe now!

🚀 Welcome to the future of data in construction!

You're taking your first step into the world of open data, working with normalized, structured data—the foundation of data analytics and modern automation tools.

By downloading, you agree to the DDC terms of use 

🚀 Welcome to the future of data in construction!

You're taking your first step into the world of open data, working with normalized, structured data—the foundation of data analytics and modern automation tools.

By downloading, you agree to the DataDrivenConstruction terms of use 

Stay ahead with the latest updates on converters, tools, AI, LLM
and data analytics in construction — Subscribe now!

DataDrivenConstruction offers workshops tested and practiced on global leaders in the construction industry to help your team navigate and leverage the power of data and artificial intelligence in your company's decision making.

Reserve your spot now to rethink your
approach to decision making!

Please enable JavaScript in your browser to complete this form.

 

🚀 Welcome to the future of data in construction!

By downloading, you agree to the DataDrivenConstruction terms of use 

Stay ahead with the latest updates on converters, tools, AI, LLM
and data analytics in construction — Subscribe now!

Have a question or need more information? Reach out to us directly!
Schedule a time to discuss your needs with our team.
Tailored sessions to help your team grow — let's plan together!
Have you attended one of our workshops, read our book, or used our solutions? Share your thoughts with us!
Please enable JavaScript in your browser to complete this form.
Name
Data Maturity Diagnostics

🧰 Data-Driven Readiness Check

This short assessment will help you identify your company's data management pain points and offer solutions to improve project efficiency. It takes only 1–2 minutes to complete and you will receive personalized recommendations tailored to your needs.

🚀 Goals and Pain Points

What are your biggest obstacles today — and your goals for the next 6 months? We’ll use your answers to build a personalized roadmap.

Build your automation pipeline

 Understand and organize your data

Automate your key process

Define a digital strategy

Move from CAD (BIM) to databases and analytics

Combine BIM, ERP and Excel

Convince leadership to invest in data

📘  What to Read in Data-Driven Construction Guidebook

Chapters 1.2, 4.1–4.3 – Technologies, Data Conversion, Structuring, Modeling:

  • Centralized vs fragmented data

  • Principles of data structure

  • Roles of Excel, DWH, and databases

Chapters 5.2, 7.2 – QTO Automation, ETL with Python:

  • Data filtering and grouping

  • Automating QTO and quantity takeoff

  • Python scripts and ETL logic

Chapter 10.2 – Roadmap for Digital Transformation:

  • Strategic stages of digital change

  • Organizational setup

  • Prioritization and execution paths

Chapters 4.1, 8.1–8.2 – From CAD (BIM) to Storage & Analytics:

  • Translating Revit/IFC to structured tables

  • BIM as a database

  • Building analytical backends

Chapters 7.3, 10.2 – Building ETL Pipelines + Strategic Integration:

  • Combining Excel, BIM, ERP

  • Automating flows between tools

  • Connecting scattered data sources

Chapters 7.3, 7.4 – ETL Pipelines and Orchestration (Airflow, n8n):

  • Building pipelines

  • Scheduling jobs

  • Using tools like Airflow or n8n to control the flow 

Chapters 2.1, 10.1 – Fragmentation, ROI, Survival Strategy:

  • Hidden costs of bad data

  • Risk of inaction

  • ROI of data initiatives

  • Convincing stakeholders

Download the DDC Guidebook for Free

 

 

🎯 DDC Workshop That Solves Your Puzzle

Module 1 – Data Automation and Workflows in Construction:
  • Overview of data sources
  • Excel vs systems
  • Typical data flows in construction
  • Foundational data logic

Module 3 – Automated Data Processing Workflow:
  • Setting up ETL workflows
  • CAD/BIM extraction
  • Automation in Excel/PDF reporting

Module 8 – Converting Unstructured CAD into Structured Formats 
  • From IFC/Revit to tables
  • Geometric vs semantic data
  • Tools for parsing and transforming CAD models

Module 13 – Key Stages of Transformation 
  • Transformation roadmap
  • Change management
  • Roles and responsibilities
  • KPIs and success metrics

Module 8 – Integrating Diverse Data Systems and Formats
  • Excel, ERP, BIM integration
  • Data connection and file exchange
  • Structuring hybrid pipelines

Module 7 – Automating Data Quality Assurance Processes 
  • Rules and checks
  • Dashboards
  • Report validation
  • Automated exception handling

Module 10 – Challenges of Digitalization in the Industry 
  • How to justify investment in data
  • Stakeholder concerns
  • ROI examples
  • Failure risks

💬 Individual Consultation – What We'll Discuss

Audit of your data landscape 

We'll review how data is stored and shared in your company and identify key improvement areas.

Select a process for automation 

We'll pick one process in your company that can be automated and outline a step-by-step plan.

Strategic roadmap planning 

Together we’ll map your digital transformation priorities and build a realistic roadmap.

CAD (BIM) - IFC/Revit model review 

We'll review your Revit/IFC/DWG data and show how to convert it into clean, structured datasets.

Mapping integrations across tools 

We’ll identify your main data sources and define how they could be connected into one workflow.

Plan a pilot pipeline (PoC) 

We'll plan a pilot pipeline: where to start, what tools to use, and what benefits to expect.

ROI and stakeholder alignment 

📬 Get Your Personalized Report and Next Steps

You’ve just taken the first step toward clarity. But here’s the uncomfortable truth: 🚨 Most companies lose time and money every week because they don't know what their data is hiding. Missed deadlines, incorrect reports, disconnected teams — all symptoms of a silent data chaos that gets worse the longer it's ignored.

Please enter your contact details so we can send you your customized recommendations and next-step options tailored to your goals.

💡 What you’ll get next:

  • A tailored action plan based on your answers

  • A list of tools and strategies to fix what’s slowing you down

  • An invite to a free 1:1 session to discuss your case

  • And if you choose: a prototype (PoC) to show how your process could be automated — fast.

Clean & Organized Data

Theoretical Chapters:

Practical Chapters:

What You'll Find on
DDC Solutions:

  • CAD/BIM to spreadsheet/database converters (Revit, AutoCAD, IFC, Microstation)
  • Ready-to-deploy n8n workflows for construction processes
  • ETL pipelines for data synchronization between systems
  • Customizable Python scripts for repetitive tasks
  • Intelligent data validation and error detection
  • Real-time dashboard connectors
  • Automated reporting systems

Connect Everything

Theoretical Chapters:

Practical Chapters:

What You'll Find on
DDC Solutions:

  • CAD/BIM to spreadsheet/database converters (Revit, AutoCAD, IFC, Microstation)
  • Ready-to-deploy n8n workflows for construction processes
  • ETL pipelines for data synchronization between systems
  • Customizable Python scripts for repetitive tasks
  • Intelligent data validation and error detection
  • Real-time dashboard connectors
  • Automated reporting systems

Add AI & LLM Brain

Theoretical Chapters:

Practical Chapters:

What You'll Find on
DDC Solutions:

  • CAD/BIM to spreadsheet/database converters (Revit, AutoCAD, IFC, Microstation)
  • Ready-to-deploy n8n workflows for construction processes
  • ETL pipelines for data synchronization between systems
  • Customizable Python scripts for repetitive tasks
  • Intelligent data validation and error detection
  • Real-time dashboard connectors
  • Automated reporting systems
123 ETL Load automatic document generation from FPDF
This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy.
Read more
×