xcarpentier / rn-pdf-reader-js

📄 PDF reader in JavaScript only for Expo - Android & iOS capable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird Characters Showing Instead of PDF

leonardolombardi07 opened this issue · comments

Issue Description

Weird characters appear instead of PDF document on IOS. Explanatory screenshot attached.

Steps to Reproduce / Code Snippets

Expo project with rn-pdf-reader-js (expo-constants, expo-file-system, etc... properly downloaded. Using https://nyc3.digitaloceanspaces.com storage as PDF source URL. Works fine on Android.

Expected Results

See PDF document instead of weird characters on the screen.

Additional Information

  • Nodejs version: 14.4.0
  • React version: 16.11.0
  • React Native version: 0.63
  • rn-pdf-reader-js version: 4.1.1
  • Platform: IOS only

WhatsApp Image 2020-11-18 at 11 16 03

I ran into this issue myself, the only difference being that I use Google Cloud Storage instead of Digital Ocean.

In my case the problem was related to this issue. The problem was that Google Cloud Storage didn't set the Content-Type header to application/pdf. Once I made GCS serve the correct Content-Type header the pdf rendered correctly.

You need to find a way for Digital Ocean to serve your PDFs with the correct Content-Type header.

I ran into this issue myself, the only difference being that I use Google Cloud Storage instead of Digital Ocean.

In my case the problem was related to this issue. The problem was that Google Cloud Storage didn't set the Content-Type header to application/pdf. Once I made GCS serve the correct Content-Type header the pdf rendered correctly.

You need to find a way for Digital Ocean to serve your PDFs with the correct Content-Type header

Problem SOLVED! Thank you very very much!