I'm trying to view a PDF in my AppGyver app, but there are some problems with it. First of all, some notes:
- The PDF can be accessed through a url to a php page which will generate the requested PDF file.
- POST data must be sent when trying to access the url / PDF file (login credentials).
- The PDF file is on an external web server.
- The user must be able to go back to the last view.
I read about using steroids.views.PreviewFileView
to view PDF files. Unfortunately it looks like this class is only supported on iOS and I would like to support Android too. The pdf can be accessed by clicking on a certain button.
I made this workaround, which creates a form by JavaScript and submits it immediately, when clicking on the button. Therefore I can request a file while sending post data and display it in the app. But when the PDF is loaded, the top part is displayed behind the navigation bar. When pinch-zooming the screen, the PDF file will be on screen entirely.
If I should use steroids.views.PreviewFileView
, how can I send POST data to the url while trying to access the file? Or should I continue the way I solved it? Cause then I would like a little help with the solution on displaying the first page of the PDF entirely on loading it.