Is there a way to make text selectable? Can some option be passed?
Do you use custom fonts? If yes, try this:
https://tkacz.pro/phantom-js-use-custom-fonts-in-html-to-pdf-convert/
@lukasamd Thanks for your reply. Yes I do use Custom fonts and Open Sans. But none of those are selectable. I'll try your approach if I need to develop my templates further.
@lukasamd I tried your approach but it is not working , Phantom not taking local font which I placed on
/usr/local/share/fonts/
and
/usr/share/fonts/
@tahv0 @lukasamd @abhinava3
I have the same issue, my custom google font is directly on the server and is generated well in the PDF but I cannot select the text from the generated PDF.
Do you have any workaround that issue ?
Thanks
Can confirm this issue is solved by installing fonts locally.
Follow this steps (after downloading custom fonts to server):
cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip (Unzip to googlefonts folder)
sudo chmod -R --reference=/usr/share/fonts/opentype /usr/share/fonts/googlefonts (can be truetype instead of opentype)
Register fonts with:
sudo fc-cache -fv
Check if installed:
fc-match OpenSans
Also it's important to check that html template you're using has the original font tag removed, otherwise it'll not use the local.
Most helpful comment
Can confirm this issue is solved by installing fonts locally.
Follow this steps (after downloading custom fonts to server):
cd /usr/share/fontssudo mkdir googlefontscd googlefontssudo unzip -d . ~/Downloads/Open_Sans.zip(Unzip to googlefonts folder)sudo chmod -R --reference=/usr/share/fonts/opentype /usr/share/fonts/googlefonts(can be truetype instead of opentype)Register fonts with:
sudo fc-cache -fvCheck if installed:
fc-match OpenSansAlso it's important to check that html template you're using has the original font tag removed, otherwise it'll not use the local.