jsPDF
jsPDF copied to clipboard
Tabulator character (\t) not printing with Roboto font
Hi, I have a solution using jsPDF where I generate a document dynamically based on user inputs. I have encounter that if the text to print contains the character \t everything that go after doesn't print in the PDF document.
Currently the PDF is using the font Roboto, in my tests I have found that without adding the Roboto font and use Helveltica for instance it prints ok by putting space between the words that contains \t between them, which I want but with the Roboto font.
I have tried as well to re-load a newer version from Google fonts, but not luck.
The following code should reproduce my problem (previously loaded the Roboto font):
var customText = '<p>This\tis\ta\ttest\tusing\ttab</p><p>This is a test using spaces</p>';
doc.setFont('roboto','normal');
doc.text(customText, 1, 10);
Output:
Expected output (with Roboto font, this one is the one by default):
Any idea of why is this happening with a custom font?
Thank you so much in advance.
Best regards,
Hi @Brank, I am new to this open source environment, so please can you guide me on what do I have to do here I want to help but I don't know how can I help
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.