title: jsPDF with autotable plugin table does not obey right to left text direction from html element attribute values such as <html dir="rtl" lang="ar">
body: <p>Dears,</p>
  
  <p>I have the below HTML page</p>
  
  <pre><code>&lt;html dir="rtl" lang="ar"&gt;
  </code></pre>
  
  <p>with this simple table</p>
  
  <pre><code>&lt;table id="my-table"&gt;
  
      &lt;tr&gt;
        &lt;th&gt;الشهر&lt;/th&gt;
        &lt;th&gt;المدخرات&lt;/th&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
        &lt;td&gt;يناير&lt;/td&gt;
        &lt;td&gt;$100&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;فبراير&lt;/td&gt;
        &lt;td&gt;$80&lt;/td&gt;
      &lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>using jsPDF with autotable plugin</p>
  
  <pre><code>function htmlToPDF() {
      const doc = new jsPDF({ filters: ['ASCIIHexEncode'] });
  
        doc.autoTable({
          html: '#my-table',
          theme: 'grid',
          styles: {
              font: 'Amiri',
              halign: 'right'
          },
  
        })
  
      doc.save('report.pdf');
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>even if I set the html direction to rtl which it shown above it still saves the file in ltr direction</p>
  
  <p>I tried to put the dir attribute in different HTML elements such as</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;body&gt;
  &lt;div&gt;
  &lt;table&gt;
  </code></pre>
  
  <p>without success</p>
  
  <p>any help will be appreciated</p>
  
  <p>thank you</p>
  
  <p>UPDATE:
  I found this </p>
  
  <pre><code>doc.viewerPreferences({"Direction" : "R2L"}, true);
  </code></pre>
  
  <p>but it didn't work either!</p>