Devlog 2026-06-07 · 11 min read

How Our AI Agents Jan and Klára Built the AI Invoice & PDF Previewer in Minutes

Explore the technical details of our new invoicing tool with a live PDF preview. Discover how AI agents Jan and Klára collaborated on its design and implementation.

AI Invoice & PDF Previewer: Faster Invoicing with AI

In the world of freelancers and small businesses, efficient invoicing is crucial. Traditional tools can often be cumbersome and lack modern features. That's why at Pixel Office, we decided to leverage our AI agents to create the AI Invoice & PDF Previewer – a tool that simplifies the generation of B2B tax invoices and offers a live preview with a payment QR code.

The Challenge: Modern Real-Time Invoicing

Our goal was to create a solution that is intuitive, visually appealing, and technically robust. We wanted users to be able to see in real-time what their invoice would look like, and easily generate and download it.

AI Agent-Driven Architecture

The development of this tool was a prime example of our agile work with AI agents:

Klára (AI Designer): Vision and User Experience

Klára was tasked with designing the user interface. She focused on cleanliness, simplicity, and visual feedback. A key feature Klára designed was an elegant, blurred PDF document preview that gives an immediate idea of the final invoice, while the main CTA offers to download the official version. Integrating a payment QR code into the preview was another brilliant idea of hers to simplify payments.

Jan (AI Coder): Implementation and Dynamics

Jan was responsible for transforming Klára's design into functional code. He used a modern JavaScript framework to create a reactive interface that dynamically updates the invoice preview as soon as the user enters data. Here's a key snippet illustrating the work with multilingual translations and component structure:

        const translations = {
            cs: {
                widgetTitle: "AI Faktura & PDF Náhled",
                yourCompanyDetails: "Údaje vaší firmy",
                companyName: "Název firmy",
                companyNamePlaceholder: "Pixel Office s.r.o.",
                companyAddress: "Adresa",
                companyAddressPlaceholder: "Praha, Česká republika",
                companyVatId: "IČO/DIČ",
                companyVatIdPlaceholder: "CZ12345678",
                clientDetails: "Údaje klienta",
                clientName: "Jméno klienta",
                clientNamePlaceholder: "Jan Novák",
                clientAddress: "Adresa klienta",
                clientAddressPlaceholder: "Brno, Česká republika",
                clientVatId: "DIČ",
                clientVatIdPlaceholder: "CZ87654321",
                invoiceDetails: "Podrobnosti faktury",
                invoiceNumber: "Číslo faktury",
                invoiceNumberPlaceholder: "FVT-2023-001"
            },
            // ... and other multilingual translations
        };

        // Example of invoice generation
        function generateInvoice(data) {
            // Logic for generating the invoice (e.g., into HTML for preview)
            return `
                <div class="invoice-preview">
                    <h1>${translations.cs.widgetTitle}</h1>
                    <h2>${translations.cs.yourCompanyDetails}</h2>
                    <p><strong>${translations.cs.companyName}:</strong> ${data.companyName}</p>
                    <p><strong>${translations.cs.companyAddress}:</strong> ${data.companyAddress}</p>
                    <p><strong>${translations.cs.companyVatId}:</strong> ${data.companyVatId}</p>

                    <h2>${translations.cs.clientDetails}</h2>
                    <p><strong>${translations.cs.clientName}:</strong> ${data.clientName}</p>
                    <p><strong>${translations.cs.clientAddress}:</strong> ${data.clientAddress}</p>
                    <p><strong>${translations.cs.clientVatId}:</strong> ${data.clientVatId}</p>

                    <h2>${translations.cs.invoiceDetails}</h2>
                    <p><strong>${data.invoiceNumber}:</strong> ${data.invoiceNumber}</p>
                    <!-- ... other invoice items and total amount -->
                </div>
            `;
        }

        // Function to send data to the server for PDF generation and sending via WhatsApp
        async function sendToWhatsApp(invoiceData) {
            try {
                const response = await fetch('/api/generate-whatsapp-invoice', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(invoiceData)
                });
                const result = await response.json();
                if (result.success) {
                    console.log('Invoice sent to WhatsApp:', result.whatsappLink);
                    window.open(result.whatsappLink, '_blank');
                } else {
                    console.error('Error sending invoice to WhatsApp:', result.error);
                }
            } catch (error) {
                console.error('An error occurred during server communication:', error);
            }
        }
"The biggest challenge was ensuring robust, reactive, and localized real-time data processing," says Jan. "We leveraged a modern JavaScript framework for lightning-fast UI updates and an intelligent translation structure that allows dynamic language switching without reloading the entire page. This ensures an excellent user experience even for complex B2B invoices."

Martin (QA): Quality and Reliability

Once the basic code was complete, Martin embarked on thorough testing. His task was to ensure that all input fields worked correctly, that the PDF preview displayed consistently across various devices and browsers, and that QR code generation was reliable. Thanks to his meticulousness, the tool is stable and error-free.

Tomáš (Deployment): Go-Live

Tomáš ensured the seamless deployment of the application. He optimized performance, set up the CI/CD pipeline, and monitoring tools to ensure the application is always available and responsive. His work guarantees that our tool reaches you in the best possible condition.

Live Demo

The best way to see everything is in practice! Try out our AI Invoice & PDF Previewer live and see how easy it is to create professional invoices:

[Try the AI Invoice & PDF Previewer here!](https://pixeloffice.eu/showcase/demo-webtrh-ai-invoice-pdf-previewer/)

Conclusion

The AI Invoice & PDF Previewer is a testament to what we can achieve when our AI agents Jan and Klára collaborate. This tool not only saves time but also brings a modern and efficient way to manage invoicing. We look forward to your feedback!

🏢

Pixel Office

Discover more about WhatsApp integration for developers.

💬 WhatsApp

More articles

AI Development

Devlog: AI Voice Agent Playground – A Revolution in B2B Communication

At Pixel Office, we proudly launched our latest lead magnet, the "AI Voice Agent Playground," allowing businesses to experience the power of AI voice assistants. Dive with us into the technical details and team collaboration behind this innovative tool.

Read more →
Devlog

New Devlog: WhatsApp CMS Gallery – A Revolution in Real-Time Project Updates

Explore the technical details of our innovative lead magnet, allowing businesses and craftsmen to update photo galleries on their website in real-time directly from WhatsApp. Discover how Socket.IO, Gemini Vision, and our AI teams collaboratively built a tool that transforms how you share your work.

Read more →
Devlog

How Our AI Agents Built a Robust UTM Campaign Link Builder in Record Time

Dive into the technical details of how our AI agents Jan and Klára collaborated to create an interactive UTM Campaign Link Builder with live preview and QR code generation, and how Martin and Tomáš brought it to perfection.

Read more →