Unable to view PDF files on mobile devices within Ionic app, only accessible through browser interface

I utilized the angularjs-pdf library to display a PDF document from a remote source within a mobile app created with Ionic Framework.

While it successfully displays the PDF in the browser, on mobile devices it only shows a blank screen.

In addition, I referred to a sample template example available at this location.

If this functionality isn't supported, kindly recommend an alternative plugin or method to efficiently showcase PDFs within the mobile application itself.

Answer №1

If you want to display a PDF in a webview, you can use the following code:

http://docs.google.com/viewer?embedded=true&url=<your-url>

This method is useful for showing remote PDF files since Android's webview does not natively support PDF viewing.

Answer №2

It seems like the angualrjs-pdf library does not fully support all browsers, likely due to its underlying pdf.js dependency not being compatible with certain mobile browsers here

You may be able to workaround this issue by integrating a different browser, but the specifics are unclear.


It would also help to gather more information on any errors encountered during remote debugging or other hints that can pinpoint the exact cause of the failure.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When attempting to retrieve data in a server-side component, Next.js encountered an ECONNREFUSED error with ::1:3000

import React from "react"; import axios from "axios"; interface UsersType { id: string; firstName: string; lastName: string; email: string; } interface dataProps { allUsers: UsersType[]; } async function getData() { try { c ...

Combining arrays in a nested array with the help of Javascript/Vue.Js

I am faced with a JSON array containing 3 arrays that I need to merge into one array after fetching the JSON data. Although I attempted to do so using Vue.JS, the resulting array appears to be empty. MY FIRST ATTEMPT this.items = items; MY LATEST ATTEMP ...

retrieve results upon expiry of time limit

What is the best way to retrieve a value after a timeout in the following function? $fetch: function($timeout) { var breadCrumbs; info = []; $timeout(function() { info = getCrumbs(); console.log(info); ...

Error: Unable to locate package @babel/preset-vue version 7.1.0

I am currently working on a simple website using Ruby on Rails and Vue.js, but I am running into issues when trying to start the local server. After executing npm run dev in the terminal, I encountered 2 errors: This dependency was not found: * /Users/mu ...

Tips for resolving the issue with configuring the payment settings on Paypal

Greetings everyone, I'm currently working on integrating the PayPal API and have completed all the necessary setups. However, I've encountered an error during the final stage of the payment process that is causing some problems. Despite following ...

How can I go about setting up $broadcast?

I've been utilizing the fantastic ngStorage plugin for Angular development. Setting up involves connecting a $scope-node to the localstorage in this manner: $scope.$store = $localStorage; The $scope.$store is now accessible across all controllers. ...

Generating Objects from Database Data Using JavaScript Automatically

I have a specific task at hand. My goal is to extract data from a database, generate a new user, and continuously monitor for new users and updates in the location of existing users (I am tracking GPS using an Android mobile app). The challenge lies in cre ...

Is it beneficial to create a separate component for React form elements?

I've come across advice that suggests when unsure, turning an element into a component is a good idea. But what are the actual benefits of converting form elements like <input /> into components? Let's consider the following example: cons ...

Filtering data in Vue.js using JSON specifications

How can I display only the names in the data? I currently have cards filtered by cities <div v-for="item in stationCityData"> <div v-for="option in filteredCity" style="background:#eee;padding: 20px"> <!-- <div v-for="option ...

Organizing layers with Leaflet's layerGroup controls

I am working with a series of Leaflet FeatureGroups, each made up of GeoJSON layers. These FeatureGroups have similar concepts but need to be kept separate for control purposes. I also require the ability to toggle all FeatureGroups on and off simultaneous ...

Is there a way to eliminate the line that appears during TypeScript compilation of a RequireJS module which reads: Object.defineProperty(exports, "__esModule", { value: true });?

Here is the structure of my tsconfig.json file: { "compileOnSave": true, "compilerOptions": { "module": "amd", "noImplicitAny": false, "removeComments": false, "preserveConstEnums": true, "strictNullChecks": ...

What is the best way to filter out and combine one array from two arrays in lodash based on their unique properties?

Lodash v 4.17.15 Consider the scenario where two arrays are involved: var users = [{ id: 12, name: Adam },{ id: 14, name: Bob },{ id: 16, name: Charlie },{ id: 18, name: David } ] var jobs = [ ...

Is it possible to utilize AJAX to load the URL and then extract and analyze the data rather than

I had originally created a web scraping method using PHP, but then discovered that the platform I was developing on (iOS via phone gap) did not support PHP. Fortunately, I was able to find a solution using JS. $(document).ready(function(){ var container ...

Angular 2 TypeScript: The concat() function operates as mutable within the framework

When I declare an array on an @Injectable provider, my intention is to use it across different components. normeList: any[] = [ { name: 'choice 1', type:'false' }, { name: 'choice 2', typ ...

Tips for accessing values in an array in asp.net (or asp-classic for optimal performance)

How can I retrieve data in a JavaScript array using ASP, and then format it in the same way as shown in this PHP example? <script>var chartdata=[{"values":[<?php $conn =mysql_connect("host","root","pass") or die ("we couldn't connect!");mysq ...

The Android JSON parsing model is encountering a ClassCastException issue where the com.google.gson.JsonObject is unable to be casted to com.google.gson.JsonArray

I recently started exploring Android development and am in the process of building an app that involves using the Zomato Rest API. To interact with this API, I've opted to utilize the Koush ION library which can be found at https://github.com/koush/io ...

Listen for changes in the div height in Angular 2 using HostListener

After spending hours researching Event Listeners in Angular 2, it's clear that there is a lack of comprehensive documentation on the topic. My goal is to set the height of various div groups (generated using ngFor) to match the height of the tallest ...

What's Vue.js error message about unknown action type?

My store was created in store/user.js export const state = () => ({ user: {}, }); export const mutations = { }; export const actions = { AUTH ({commit},{email, password}){ console.log('email, password =', email, password) } }; ...

"Exploring the Method of Inheriting from a BaseComponent in Angular 2

I’ve been working on an Angular project and I’m looking to streamline the creation of components with shared functionality. For example, let’s say I have a TeacherIndexComponent: @Component({ selector: 'app-teacher-index', templateUrl: ...

Unable to trigger ng-click event on an element that has been compiled in a controller

Is there a way to utilize $compile in order to enable ng-click functionality on a specific code block? Currently, my code is set up to display a suggestion box when certain event parameters are met. However, I am looking to give users the ability to hide t ...