ai-pdf-genration-english
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ai-pdf-genration-english [2026/10/12 13:53] – misa | ai-pdf-genration-english [2026/10/12 15:50] (current) – [2. How it works under the hood] misa | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | = Generating Professional | + | ====== AI-Generated |
| - | //Last updated: 12.10.2026 | + | > **TL;DR:** Upload the .xlsx (as attachment, or place it in '' |
| - | //Owner: [Hrishabh] // | + | |
| - | //Status: Production-Ready | + | |
| - | ---- | + | ===== 1. What is possible ===== |
| - | == 1. Purpose == | + | The AI assistant runs in a Linux environment and can turn a raw Excel export into a finished, presentation-ready A4 PDF report without any manual layout work: cover page, KPI dashboard, charts, formatted tables, status badges, page footers with page numbers – in the language of the data (German or English). It works best when the Excel file contains structured lists with status columns, areas, quantities or references. |
| - | This document explains the repeatable process for converting raw Excel workbooks (e.g. camera inventory lists, status-quo tracking sheets) into **professional, | + | ===== 2. How it works under the hood ===== |
| - | ---- | + | ^ Component |
| + | | '' | ||
| + | | '' | ||
| + | | HTML/CSS + '' | ||
| + | | '' | ||
| - | == 2. Prerequisites == | + | The standard pipeline: **read → understand → summarize → build charts → build HTML report → render PDF → verify pages → iterate on feedback.** |
| - | ^ Requirement ^ Details ^ | ||
| - | | **AI tool** | " | ||
| - | | **Source file** | An `.xlsx` workbook with the data to be reported (one sheet, structured rows/ | ||
| - | | **Access to output folder** | `/ | ||
| - | | **Internet connection** | Required for the builder session | | ||
| - | | **No local installs needed** | Python, openpyxl, matplotlib, and WeasyPrint are installed in the builder environment | | ||
| - | ---- | ||
| - | == 3. Process Overview | + | ===== 3. Prerequisites ===== |
| - | The full workflow takes **5–10 minutes** per report | + | * The Excel file (.xlsx), ideally one sheet per topic |
| + | * A fixed output folder and filename, e.g. ''/ | ||
| + | * A decision: | ||
| + | * Optional: brand colors or a logo image you want on the cover | ||
| - | ┌──────────────┐ | + | ===== 4. Step-by-step workflow ===== |
| - | │ 1. Upload | + | |
| - | │ Excel file │ | + | |
| - | └──────────────┘ | + | |
| - | **Step-by-step:** | + | - **Step |
| + | - **Step 2 – Send the initial prompt** (Section 5, Prompt A or B). Always include: what to do + exact target folder + filename. | ||
| + | - **Step 3 – Let it read first.** The AI dumps the workbook structure, identifies sections/ | ||
| + | - **Step 4 – Generation.** Charts are generated, the report is laid out (cover, dashboard, sections, detail tables, open items), and the PDF is rendered into your target folder. | ||
| + | - **Step 5 – Page-by-page review.** The AI renders pages to images and shows you key pages (cover, summary, charts, tables, final page). Look at: totals, spellings, colors, missing rows. | ||
| + | - **Step 6 – Iterate with short fix prompts** (Section 5, Prompt C). Typical fixes: wrong total in a chart, typo, extra section, color change, logo. | ||
| + | - **Step 7 – Handover & cleanup.** Confirm the file location, then ask the AI to delete its temporary files (Section 5, Prompt D). | ||
| - | # **Upload** the `.xlsx` file as an attachment in the chat (paperclip icon). | + | ===== 5. Prompt library |
| - | # **Describe** what you want in plain language — see §5 for proven prompt templates. | + | |
| - | # The AI **reads every row and column**, detects structure, categories, statuses, and dates automatically. | + | |
| - | # The AI **generates charts** (donut, bar, timeline) and a full HTML/CSS report layout. | + | |
| - | # The AI **renders the PDF** (A4, with cover page, headers, footers, page numbers) into the target folder. | + | |
| - | # You **receive the PDF** as a clickable file link — download or forward to your customer. | + | |
| - | ---- | + | **Prompt A – initial request, new report:** |
| + | < | ||
| + | Read the attached Excel file " | ||
| + | Before building anything, summarize what you understand: sheets, key columns, | ||
| + | statuses, and all relevant counts – I will confirm before you proceed. | ||
| + | Then create a professional customer-presentation PDF based on it with: | ||
| + | cover page with key numbers, summary dashboard with KPI cards, charts, | ||
| + | clean detail tables, status badges, and a footer with page numbers. | ||
| + | Save the result to: / | ||
| + | </ | ||
| - | == 4. Worked Examples == | + | **Prompt B – new file, same style as before:** |
| + | < | ||
| + | I uploaded a new Excel file " | ||
| + | Create a professional PDF report (same style as the last one: cover, KPI dashboard, | ||
| + | charts, tables, open-items section with recommended actions). | ||
| + | Save it to / | ||
| + | </ | ||
| - | === Example A: "AS von Status Quo.xlsx" | + | **Prompt C – fixes / iterations (one issue per message works best):** |
| + | < | ||
| + | Page 3, chart "Kameras nach Bereich": the numbers do not add up to the total (342). | ||
| + | Fix the chart so all categories are included and re-render the PDF. | ||
| + | </ | ||
| - | * **Source data:** 152 camera positions across 3 video systems (Video 1/ | + | < |
| - | * **Output:** 16-page PDF — `StatusQuo_Bericht_Kundenvorstellung.pdf` | + | Change the accent |
| - | * **Contents: | + | </code> |
| - | * Cover page with KPIs (152 positions, 9 halls, 28 defects fixed, open items) | + | |
| - | * Executive summary with donut chart (OK / Behoben / Offen) | + | |
| - | * Distribution charts by hall and by camera source | + | |
| - | * Full detail tables per video system with color-coded status pills | + | |
| - | * Open-items table + AN-1940 order positions + KFZ recognition gaps | + | |
| - | * 4-step action plan for the customer | + | |
| - | === Example B: " | + | < |
| + | Add our company logo (attached) to the top-left of the cover page. | ||
| + | </ | ||
| - | * **Source data:** 342 NVR camera entries (name, channel IP, device IP, area, firmware, model, network status, video signal, recording status, image diagnosis, arm status) | + | **Prompt D – cleanup after handover:** |
| - | * **Output:** 22-page PDF — `Kamera Netzwerkliste.pdf` | + | < |
| - | * **Contents: | + | The report is final. Delete all temporary files you created for it (chart |
| - | * Cover page with KPIs (342 cameras, 98.8% online, 7 NVRs, 4 offline) | + | HTML, scripts, page previews) and confirm that only the final PDF remains in |
| - | * Executive summary with status donut + key messages | + | / |
| - | * Area distribution | + | </ |
| - | * NVR infrastructure table (7 recorders with IP, model, firmware, camera count) | + | |
| - | * **Complete 342-row camera list** with per-camera status pills | + | |
| - | * Offline-cameras table with recommended remediation steps | + | |
| - | ---- | + | ===== 6. Case studies ===== |
| - | == 5. Prompt Templates (Copy & Paste) | + | ==== 6.1 "AS von Status Quo.xlsx" |
| - | > **Tip:** The more specific your prompt, the better the first result. You can always iterate with follow-up messages | + | | ^^Item^^ | ^^Value^^ |
| + | | Source file | '' | ||
| + | | Output | ''/ | ||
| + | | Content | 152 camera positions across Video 1 / Video 2 / Video 3 + parking items, halls 1–9 plus outdoor areas | ||
| + | | Status mix | 106 in operation · 28 defects fixed (22.–29.07.2026) · 12 mounted but not in system · 4 open orders (AN 1940) · 2 missing vehicle recognition | ||
| + | | Highlights | Color legend taken 1:1 from the sheet (RE 1309 yellow, AN 1940 green, RE 1296 orange, AN 1801 blue, Bestand grey, Parkraumüberwachung purple); " | ||
| + | | Lessons | The AI caught two of its own typos and a misclassified status only because pages were visually checked; always review cover + dashboard + at least one detail page | ||
| - | === 5.1 Basic report generation | + | ==== 6.2 " |
| - | Read this Excel file. It is in [German/ | + | | ^^Item^^ | ^^Value^^ |
| - | PDF report for customer presentation. Save it to / | + | | Source |
| - | | + | | Output | '' |
| - | Include: cover page, executive summary with KPIs, charts, | + | | Content | 342 cameras on 7 NVRs across 16 areas; 338 online & recording |
| - | and an open-items / action-plan section. | + | | Highlights | Cover KPIs, status donut, area + model charts, |
| + | | Lessons | The first upload did **not** land on the server disk (only a preview was visible). Solution: asked to re-upload; the file then appeared | ||
| - | === 5.2 With specific design requirements | + | ===== 7. Checklist for a professional look ===== |
| - | Read the attached Excel file and generate a customer-facing PDF report. | + | * Cover page: title, |
| - | Requirements: | + | * Dashboard: big number cards + one status |
| - | - Language: German | + | * Charts must sum to the total row count – **always verify** (real bug caught in Case Study B) |
| - | - A4 format, professional corporate look (dark navy + gold accent) | + | * Status colors stay consistent |
| - | - Cover page with title, KPI cards, date | + | * Page footer with report |
| - | - Donut chart for status | + | * Source reference at the end: document name, sheet, export date/time, author |
| - | - Bar charts for distribution by [area / hall / department] | + | * One coherent palette (navy + one accent color worked well here) |
| - | - Full detail table with all rows from the sheet | + | |
| - | - Color-coded status | + | |
| - | | + | |
| - | - Save to: /home/ | + | |
| - | === 5.3 Iteration / correction | + | ===== 8. Context management & cleanup – important ===== |
| - | The report looks good. Please fix the following: | + | > **WARNING: |
| - | 1. Change " | + | |
| - | 2. Position 39 is already resolved — move it from " | + | |
| - | 3. Add a section 6 with recommended next steps as numbered action items | + | |
| - | Regenerate the PDF in the same location. | + | |
| - | ---- | + | * **One project per chat.** Start a fresh chat for every new Excel/ |
| + | * **Delete chats you no longer need** (you do this in the app UI – the AI cannot delete your own chat history). Unused chats are a wasted resource and clutter. | ||
| + | * **Clean up generated temp files after handover.** Ask the AI (Prompt D) to remove chart PNGs, HTML and page previews it created. Do not let 10+ preview images and intermediate files accumulate in the working folder or get re-read into the chat later. | ||
| + | * **Attach each file only once per project.** Re-uploading a slightly edited version of the same big Excel is one of the fastest ways to blow up the context. If the data changed significantly, | ||
| + | * **Keep the Excel slim:** delete unused sheets/ | ||
| + | * **State your target once, precisely** (absolute folder + exact filename) in the first prompt; vague requests cause extra rounds of back-and-forth, and every round costs context. | ||
| + | * **Overwrite the same output file** instead of producing v1/v2/v3 copies. | ||
| + | * **If a chat starts to feel heavy** (slow answers, forgotten instructions), | ||
| + | < | ||
| + | State summary for continuation: | ||
| + | Project: camera network report. Source: Kamera Netzwerkliste.xlsx. | ||
| + | Output: / | ||
| + | Next step: add our company logo to the cover page only. | ||
| + | </ | ||
| + | * **Do not paste huge text dumps** (full console output, entire HTML) into the chat. If something went wrong, describe the symptom in 1–2 sentences and point at the file/page – let the AI read the file itself. | ||
| - | == 6. What the AI Can and Cannot Do (Limitations) | + | ===== 9. Troubleshooting ===== |
| - | === Capabilities === | + | | ^^Symptom^^ | ^^Fix^^ |
| - | * Read `.xlsx` files (all sheets, all cells, including merged cells and cell fills/ | + | | AI cannot find the uploaded |
| - | * Detect structure: headers, data rows, sections, color-coded categories | + | | Wrong totals |
| - | * Parse German / English / mixed-language content | + | | PDF looks plain for a customer meeting | Request: cover + KPI dashboard + donut/bar charts |
| - | * Generate matplotlib charts (donut, bar, timeline, stacked) | + | | Detail row missing or misread |
| - | * Render full HTML/CSS → PDF via WeasyPrint (A4, multi-page, cover, footers) | + | | Chat becomes slow or forgets instructions | Fresh chat + state summary (Section 8); delete old unused chats |
| - | * Handle 150–350+ row datasets in a single pass | + | | German characters wrong | Should work out of the box (UTF-8, DejaVu fonts); if not, report it together with a page screenshot |
| - | * Apply your color palette and brand colors from the Excel legend | + | |
| - | * Write report text in German or English (or both) | + | |
| - | + | ||
| - | === Limitations === | + | |
| - | + | ||
| - | ^ Limitation | + | |
| - | | **Cannot browse your file server** — uploaded files only land in `/tmp` or `inbox/ | + | |
| - | | **Cannot access live systems** (NVR, CRM, ERP) | Export | + | |
| - | | **No image/photo support** from Excel (e.g. camera snapshots embedded in cells) | Provide photos as separate attachments if needed | + | |
| - | | **Charts are matplotlib PNGs** — not interactive SVG/HTML charts | Acceptable for print PDFs; for web, request HTML export instead | + | |
| - | | **One session = one context window** — very large workbooks (10k+ rows) may need splitting | + | |
| ---- | ---- | ||
| - | + | //Author: < | |
| - | == 7. Troubleshooting == | + | |
| - | + | ||
| - | === Problem: "File not found on disk" === | + | |
| - | The attachment did not land where the AI expected it. **Fix:** | + | |
| - | # Ask the AI to run `find / -iname " | + | |
| - | # If it's in `/home/ | + | |
| - | # Worst case: re-upload the attachment in the same chat. | + | |
| - | + | ||
| - | === Problem: AI misread a column or mixed up two columns === | + | |
| - | **Fix:** Point to the specific row/ | + | |
| - | + | ||
| - | In row 14, column H says " | + | |
| - | should be listed as OPEN, not OK. Please re-check the status classification | + | |
| - | and regenerate the table. | + | |
| - | + | ||
| - | === Problem: Chart numbers don't add up === | + | |
| - | **Fix:** Ask the AI to print the per-category counts before generating the chart: | + | |
| - | + | ||
| - | Before you render the donut chart, print the exact count for each category | + | |
| - | so I can verify the total equals 342. | + | |
| - | + | ||
| - | === Problem: PDF has a layout glitch (text overflow, missing page) === | + | |
| - | **Fix:** Request a targeted re-render: | + | |
| - | + | ||
| - | Page 8 has text overflowing in the " | + | |
| - | Reduce the font size of that table to 7pt and widen the name column to 32%. | + | |
| - | Regenerate only pages 6–14. | + | |
| - | + | ||
| - | === Problem: Wrong date or wrong language === | + | |
| - | **Fix:** Explicitly state in your prompt: " | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | == 8. ⚠️ Context Size Management — READ BEFORE EACH SESSION == | + | |
| - | + | ||
| - | > **This is the single most important section. Ignoring it will cause failed sessions, truncated outputs, and lost work.** | + | |
| - | + | ||
| - | === 8.1 Why context size matters === | + | |
| - | Every message you send, every file the AI reads, and every response the AI generates all consume a **shared context window** (a finite token budget). Once the window is full: | + | |
| - | * The AI starts **forgetting earlier instructions** (" | + | |
| - | * Long outputs get **truncated mid-sentence** | + | |
| - | * File reads return **partial data** | + | |
| - | * In worst case, the session **errors out** and you must restart | + | |
| - | + | ||
| - | === 8.2 Rules to follow (non-negotiable) === | + | |
| - | + | ||
| - | # **Delete generated files after downloading.** Every PDF, PNG, or HTML file left in the workspace can be re-read into the context if you ask the AI to inspect them again. Once you have your PDF, clean up: | + | |
| - | rm / | + | |
| - | rm /tmp/*.png / | + | |
| - | + | ||
| - | # **Start a NEW chat for each new report.** Do not chain 5 different Excel reports into one conversation. Each report is a self-contained task. A fresh chat = full context budget. | + | |
| - | + | ||
| - | # **Do NOT upload the same file twice.** If you already attached `Report.xlsx` and the AI read it, do not re-attach it "just in case". The AI already has it in memory. | + | |
| - | + | ||
| - | # **Delete unused / finished chats regularly.** Old conversations stay stored server-side and can bloat your account' | + | |
| - | * Go to each completed chat → **Delete chat** (or " | + | |
| - | * Keep only the 1–2 active conversations. | + | |
| - | + | ||
| - | # **Keep prompts focused.** One report per message. Don't paste in 500 lines of extra context, screenshots, | + | |
| - | + | ||
| - | # **If a session feels " | + | |
| - | + | ||
| - | === 8.3 Quick " | + | |
| - | + | ||
| - | [ ] Downloaded & verified the last PDF? | + | |
| - | [ ] Deleted /tmp/*.png, / | + | |
| - | [ ] Closed or deleted all other finished chats? | + | |
| - | [ ] New chat opened? | + | |
| - | [ ] Excel file attached ONCE? | + | |
| - | [ ] Prompt written with: language, output path, section list, style? | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | == 9. Additional Tips & Best Practices == | + | |
| - | + | ||
| - | * **Name your files clearly.** `Kamera Netzwerkliste.pdf` is better than `report_final_v3_actual.pdf`. The AI uses the Excel filename as the PDF name by default. | + | |
| - | * **Keep the Excel clean.** Remove hidden columns, stray rows, and merged header cells before uploading — it reduces misinterpretation risk. | + | |
| - | * **Use the color legend in your sheet.** If row 1 contains a color key (" | + | |
| - | * **Ask for a "dry run" on large files first:** | + | |
| - | Before generating the PDF, just list the categories and counts you detected | + | |
| - | so I can verify the structure is correct. | + | |
| - | * **Version control your reports.** After each generation, copy the PDF to a dated subfolder: | + | |
| - | mkdir -p / | + | |
| - | cp "/ | + | |
| - | / | + | |
| - | * **For recurring reports** (monthly camera status), save your prompt as a DokuWiki snippet or text file so you never have to rewrite it. | + | |
| - | * **The AI cannot see what is NOT in the Excel.** If a camera was removed on Monday, the report reflects the Excel — not the live system. Always export fresh data. | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | == 10. File Locations Quick Reference == | + | |
| - | + | ||
| - | ^ Path ^ Purpose ^ | + | |
| - | | `/ | + | |
| - | | `/ | + | |
| - | | `/ | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | == 11. Revision History == | + | |
| - | + | ||
| - | ^ Date ^ Author ^ Change ^ | + | |
| - | | 12.10.2026 | [Hrishabh] | Initial version: process, examples A+B, prompts, context management guide | | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | //Questions or improvements? | + | |
ai-pdf-genration-english.1791813197.txt.gz · Last modified: by misa
