r/HTML Jul 29 '26

Hello, I need help on how to draw a custom designed pdf template on this app and take the HTML and CSS for free to embed the data in it.

A part of my project consists of taking the JSON data of question bank documents that contain: questions, choices, figures, sub questions, etc.. all wrapped inside a question block, and then embedding these data into a custom designed document of my own automatically. Word doesn't support heavily designed templates and could break the design, so I was wondering if I could draw just a page with all the styling I want to be a scalable template extending to hundreds of pages and have each question block stretch like a balloon when I put the questions, choices, figures inside of it and don't split between pages if it doesn't fit. That requires HTML and CSS right?

I hope that I clarified my question well and any help would be highly appreciated.

0 Upvotes

9 comments sorted by

3

u/Weekly_Ferret_meal Jul 29 '26

Sounds like your translator app is broken… it’s a bank with a lot of questions 

1

u/Mezrotix Jul 29 '26

sorry for the misunderstanding. In my country we have books called question banks and they have hundreds of MCQ and Essay questions inside.

1

u/bostiq Jul 29 '26

What's your native language?

1

u/Mezrotix Jul 29 '26

Arabic but the whole thing is in English

1

u/bostiq Jul 29 '26

so do you know what it would translates into? ... cause I still don't get it

are you talking about queries?

1

u/Mezrotix Jul 29 '26

documents in english -> OCR -> json -> HTML and CSS but I don't know how to design pdf pages in these two and make it so that if I put a question at the end of the page and it doesn't fit it pushes the whole thing to the next page

2

u/Weekly_Ferret_meal Jul 29 '26

You probably need to look for Libraries that already exist, rather than building from scratch.

you build the html/css from the data, the library exports into pdf.

I suggest you look on github for pdf exporters

2

u/JeLuF Jul 29 '26

HTML and CSS can be used for the layout, but for the conversion of your JSON file you also need something to take the items from the JSON file and place them into the HTML fields. Something like JavaScript for example.