I need to generate a PDF file in PHP that includes dynamic Marathi text.
I’ve tried multiple libraries like TCPDF, mPDF, FPDF, DomPDF, and even generated SVG images with fonts like Noto Sans Devanagari and Mangal. Some of these approaches work partially, but none of them print the Marathi text exactly as I input it.
For example, my input is:
माझं नाव हर्ष आहे. मी वेब डेव्हलपर आहे.
But the output looks distorted or incorrect see this image
I’m using a shared hosting server, so I can’t install any system-level fonts or binaries.
Has anyone successfully printed accurate Marathi text in a PDF using PHP, especially on shared hosting? Any suggestions or workarounds that work reliably?
Thanks in advance!