Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
Binary file modified components/.DS_Store
Binary file not shown.
Binary file added components/global-file-viewer/.DS_Store
Binary file not shown.
Binary file added components/smart-pdf-engine/.DS_Store
Binary file not shown.
55 changes: 55 additions & 0 deletions components/smart-pdf-engine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Username

widlestudiollp

## Project Name

Smart Auto PDF Engine

## About

Smart Auto PDF Engine is an intelligent, auto-detecting document generator for Retool that analyzes any input data and transforms it into a structured, printable document with live preview and PDF export functionality. It supports multiple document types such as invoices, reports, payslips, and generic data layouts without requiring predefined schemas.

The component automatically interprets raw JSON, detects structure, and renders a clean UI along with a high-quality downloadable PDF. This allows developers to quickly generate professional documents from any backend response with minimal configuration.

## Preview

![Smart Auto PDF Engine Preview](cover.png)

## How it works

The component receives data via Retool state (`schema`) and processes it using a smart normalization engine. It evaluates the structure of the data and converts it into a unified internal model that can be rendered both in UI and PDF format.

### Data interpretation logic

* Structured data (`sections`) → Render directly (grid, table, text, summary)
* Flat objects → Converted into key-value sections
* Nested objects → Recursively expanded into multiple sections
* Arrays of objects → Converted into tables
* Arrays of primitives → Rendered as text
* Mixed / irregular data → Safely normalized and displayed without breaking

### Document detection logic

* Invoice-like data → Invoice layout
* Payslip-like data → Salary/payslip layout
* Analytical data → Report layout
* Unknown structure → Generic document layout

### Example input

```json
{
"employee": {
"name": "John Doe",
"department": "Engineering"
},
"earnings": {
"basic": 50000,
"hra": 20000
},
"deductions": {
"tax": 8000
},
"netPay": 62000
}
Binary file added components/smart-pdf-engine/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions components/smart-pdf-engine/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"id": "smart-auto-pdf-engine",
"title": "Smart Auto PDF Engine",
"author": "@widlestudiollp",
"shortDescription": "A fully automated PDF generation engine that intelligently interprets any JSON data and transforms it into a structured, responsive document with preview and download capabilities.",
"tags": [
"PDF Generator",
"Auto Layout",
"Smart Rendering",
"Invoices",
"Reports",
"Data Processing",
"No-Code",
"Retool"
]
}
52 changes: 52 additions & 0 deletions components/smart-pdf-engine/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "my-react-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@tryretool/custom-component-support": "latest",
"html2canvas": "^1.4.1",
"jspdf": "^4.2.1",
"jspdf-autotable": "^5.0.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"uuid": "^13.0.0"
},
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"dev": "npx retool-ccl dev",
"deploy": "npx retool-ccl deploy",
"test": "vitest"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react": "^18.2.55",
"@types/react-scroll-to-bottom": "^4.2.5",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"postcss-modules": "^6.0.0",
"prettier": "^3.0.3",
"vitest": "^4.0.17"
},
"retoolCustomComponentLibraryConfig": {
"name": "SmartPdf",
"label": "Smart Pdf",
"description": "Smart Auto detect Pdf engine.",
"entryPoint": "src/index.tsx",
"outputPath": "dist"
}
}
Loading
Loading