This topic is locked

Change the default PDF font to Arabic or any language

5/2/2023 3:37:31 PM
PHPRunner Tips and Tricks
A
alghanim author

1- Enter the link
link
2-Copy the code create a file name.js
Runner.PDF.vfs = Object.assign( Runner.PDF.vfs || {}, { "name.ttf":"Paste the code here" });3-Then copy and paste the file C:\Program Files\PHPRunner10.9\source\include\common\pdfmake
4- go to C:\Program Files\PHPRunner10.91\source\include\common\runnerJS\pdf.js
Search to copy and edit
` /**

  • costom font
  • @param {function} callback
    */
    loadArabicFont: function( callback ) {
    if ( pdfMake.fonts["namefont"] ) {
    window.setTimeout( callback, 0 );
    return;
    }

Runner.util.ScriptLoader.addJS( [ settings.global["webRootPath"] + 'include/pdfmake/namefont.js' ] );
Runner.util.ScriptLoader.onFilesLoaded( function() {
pdfMake.fonts["namefont"] = {
normal: 'namefont.ttf',
bold: 'namefont-Bold.ttf',
italics: 'namefont-Italic.ttf',
bolditalics: 'namefont-BoldItalic.ttf',
};
callback();
});

Runner.util.ScriptLoader.load();
},Search to ARABIC_FONT ARABIC_FONT: 'namefont',`

A
alghanim author 5/2/2023

After changing the font
img alt

I
ibrahim 6/12/2023

Hello, Thank you for providing this instructions, but can you please make steps easier, some of them are not clear how to implement
for example:

  • what to make in the first step with a the link should i upload the whole font file, it will create a large encoded text?* in step 4 "Search to copy and edit" would you illsutrate steps a little bit?
    I appreciate your help

A
alghanim author 6/23/2023

The explanation is very easy
Contact me on mail
alghanim.1@hotmail.com