Converting Figma design JSON data to PDF with actual text elements

Hey everyone! I’m working with the Figma API and I can pull design files as JSON data. Now I need to modify this JSON and convert it back to PDF format. The tricky part is that I want the PDF to contain real text elements and other actual nodes, not just a flattened image.

I’ve seen some workarounds where people convert the design to an image first and then put that image in a PDF, but that’s not what I’m after. I need the text to be selectable and the elements to be actual PDF components.

I’ve been through the Figma REST API documentation but couldn’t find any endpoint that takes JSON input and returns a PDF with real nodes. Has anyone found a different approach for this? I’m using PHP and the PDF libraries I’ve tried aren’t great for this task, plus there are font issues since you need all the fonts locally that Figma already handles in their editor.

I did something similar six months ago. Figma’s JSON doesn’t translate directly to PDF components - that’s the main problem. I created an intermediate step that converts Figma JSON into a PDF-friendly structure first. Used PHP with DomPDF and built a custom renderer that reads Figma nodes and recreates them as HTML/CSS, then converts to PDF. This keeps text selectable and maintains proper element structure. Positioning’s tricky - you’ve got to convert Figma’s coordinate system to something PDF libraries can handle. For fonts, I set up fallbacks that use web-safe alternatives when the original fonts aren’t available locally. It’s not a perfect 1:1 match but creates usable PDFs with proper text elements.

Had this exact problem last year with a document generation system. Figma’s JSON doesn’t play nice with PDF elements - they use completely different rendering models. I built a custom parser that maps Figma text nodes to PDF text objects using TCPDF or FPDF in PHP. You’ll have to handle positioning calculations yourself since Figma uses absolute positioning and PDF libraries typically work with flow-based layouts. The font issue’s a pain. I created a font mapping system that swaps Figma fonts with local ones - not perfect, but it works. Alternatively, use headless Chrome with Puppeteer to render the design as HTML first, then convert to PDF. This keeps text selectable.

yea, i get that! it’s a pain when u need real text in PDF. maybe try using a library like jsPDF? it can help with the text elements directly from JSON. just keep in mind font stuff, u might still run into issues with web fonts!

Honestly, this sounds like a nightmare lol. Why not just rebuild the layout from scratch using the Figma JSON as reference? Parse the text nodes and recreate them in your PDF lib with similar positioning. Won’t be pixel perfect, but you’ll get selectable text without all the conversion headaches.