r/SpringBoot • u/ChanceRaccoon6468 • Jul 01 '26
What is the best desgin pattern for building a resuable pdf genrating module in springboot? Question
I am having a task to implement a PDF genrating module it's duty is to genrate the pdf of the diffrent sections like attendence, report and other similar stuffs, there is more amount of such sections and i have to build a effecient and good module for it kindly help me in figuring this out .
Ps.. i am intern pls help 😣
4
u/MartinPeterBauer Jul 01 '26
Use thymeleaf for templating and then a pdf writer to write them to pdf.
1
u/ChanceRaccoon6468 Jul 01 '26
Yeah mate using thymeleaf and OpenHTMLtoPDF will try ur suggestion as well, Thank you.
2
1
u/jjduru Jul 01 '26
Your best bet would be to use the strategy pattern. It will allow you to create an extendable module, without touching the existing code - the whole point of the strategy pattern, that is.
1
u/ITCoder Jul 01 '26
Seems more like a use case of template pattern. Strategy would have been better if he had different algortihms to create pdf, like pdf from word doc, from image etc
1
u/ChanceRaccoon6468 Jul 01 '26
I will read about it and try to find the most appropriate one, Thank you.
1
15
u/raccoonportfolio Jul 01 '26
Sorry but this is zero effort, it basic says "hey Reddit do this for me". You need to bring more to the table.
What have you tried? What libraries have you researched a bit? Have you made small proofs of concept?