title: How to parse pdf in js fetch
body: <p>I am fetching data following <a href="https://stackoverflow.com/a/50812705/9640177">this answer</a>. It works very well for html pages. But I am trying to get link to pdf file.</p>
  <pre><code>                          fetch(v3).then(function(d) {
                                  console.log(d);
                                  return d.text();
                              }).then(function(h) {
                                  console.log(h); //--------------------
  //--------------------------------------
                              }).catch(function(err) {
                                  console.log(err);
                              })
  </code></pre>
  <p><code>console.log(h)</code> in above code return</p>
  <pre><code>%PDF-1.5
  
  %����
  
  1 0 obj
  
  &lt;&lt;/Type/Catalog/Pages 2 0 R/Lang(en-SG) /StructTreeRoot 26 0 R/MarkInfo&lt;&lt;/Marked true&gt;&gt;&gt;&gt;
  
  endobj
  
  2 0 obj
  
  &lt;&lt;/Type/Pages/Count 4/Kids[ 3 0 R 15 0 R 22 0 R 24 0 R] &gt;&gt;
  
  endobj
  
  3 0 obj
  
  &lt;&lt;/Type/Page/Parent 2 0 R/Resources&lt;&lt;/Font&lt;&lt;/F1 5 0 R/F2 9 0 R/F3 11 0 R/F4 13 0 R&gt;&gt;/ExtGState&lt;&lt;/GS7 7 0 R/GS8 8 0 R&gt;&gt;/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] &gt;&gt;/MediaBox[ 0 0 841.92 595.32] /Contents 4 0 R/Group&lt;&lt;/Type/Group/S/Transparency/CS/DeviceRGB&gt;&gt;/Tabs/S/StructParents 0&gt;&gt;
  
  endobj
  
  4 0 obj
  
  &lt;&lt;/Filter/FlateDecode/Length 7669&gt;&gt;
  
  stream
  
  x���K��8������t��l�D�za����cwo?�����w�����0v��*=��_&gt;��%2�L*m�
  ��`D(�&quot;��(���������S�׿^?9����&lt;��^]����������׿�����N7w��/&gt;�qR���xxs���ߪo�}Z���n�?�;�WM5
  VO�ꦮnyu�|����R�&gt;~���Ǐ��������˷��1)�T������z�A�&lt;�1T������m�ߞ?~�jW���^���G������Q��sdiG۾f�S��v���������Q=���￭�����mWO������&lt;~�����Uk~�Տ��^��� �śU��G��f���jE݌US�B�z����ee�m���J/۶��X��u�P�����a�%v��+��&gt;�y����VO��2�o�bws�A~�q�S�&gt;��b`�@�|zx�_u�r�{��ݮ��av/y��K�#�����/�m��2�̓J龺W��k!�|���V*��x3�u�%���/T…
  </code></pre>
  <p>My question is how to parse this data into meaningful data?</p>