Skip to content
Advertisement

Getting spacing issues in TCPDF with writeHTML

I am creating a PDF with HTML contents using the writeHTML function of TCPDF. Below is the relevant code:

JavaScript

With this code, I am getting some weird overlapping of the text marked to be bold and the rest of the text, as shown below:

enter image description here

Any help to resolve this would be appreciated.

Note that: The HTML here is being received from a front end as via an XMLHTTPRequest, and must be presented as it is in the PDF document.

Advertisement

Answer

I was unable to find the root cause for this issue. But I ended up using the mPDF library and was able to get the text to render correctly.

I hope this info helps someone in the future. Of course if anyone can point out the reason for the issue it would be great.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement