0

I try to download a pdf which i get from a ajax request.

it looks like this in the console:

<>/Metadata 193 0 R/ViewerPreferences 194 0 R>> endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/XObject<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/MediaBox[ 0 0 595.32 841.92] /Contents 4 0 R/Group<>/Tabs/S/StructParents 0>> endobj 4 0 obj <> stream x��]o�6��G��(��( ��������-��&�np];�x��ou��C��lrH���E[ע�7�!�3����/�v���]��ח/v����]������˛?ח׫����a��|���|�z��[?}�M��۫��gB���7eS�R%��Np^<�����E�9?�ljj8�Ƽ�9?�����/n���HQ�I��ZӲ����zثw�x�|~����1=����>���W�g�.�.+n�z~����i�6�)Eu�Ρ��%<�6��R.6��Xln������[l���Z��T�Ԥ$���O���T�u.����^�ځZ��(����Њ�Bɺd��ר��r�v����ޚ�X��U� ��F��5'e�ӥ�[hz��cT�44=֨w�춗��n��p�o���7G���$�(��|�L)��m����YS����fZ��+!s�0����b���n��n���cV���"kЮ�D/+^PQ ־

P. Frank
  • 5,691
  • 6
  • 22
  • 50
  • It is a conflict between your requested encoding and the enabled one on target server. – Reporter Oct 19 '17 at 08:35
  • @reporter so that means? –  Oct 19 '17 at 08:41
  • It means: you want to get the pdf and wrote in code uft-8 and on server the encoding is cf-1295. Another possibility is the doesn't support gzip. I don't know the exact reason, but your posted "image" is not unknow for me. – Reporter Oct 19 '17 at 08:57
  • Maybe https://stackoverflow.com/questions/36474285/internet-explorer-external-text-files-are-only-available-in-binary-format let you lead into the right way. – Reporter Oct 19 '17 at 08:59
  • i can download the response but, how can i convert it into a correct pdf file? the downloaded file has the weird content from my post above. –  Oct 19 '17 at 09:14
  • Have you added the contenttype for pdf, so the browser can see it is a pdf file? – Reporter Oct 19 '17 at 09:16
  • yes i did in the request "contentType": "application/pdf" –  Oct 19 '17 at 10:17

0 Answers0