Question

1
Replies
45
Views
Close popover
Vishal Rajoria (VishalRajoria)
Sunlife
Senior Specialist Development
Sunlife
IN
VishalRajoria Member since 2013 3 posts
Sunlife
Posted: December 24, 2020
Last activity: January 4, 2021

How to disable Webview in Pega Mobile app - Pega 8.3.2

We have a requirement in which we need to generate PDF from an HTML in Pega mobile offline mode. HTMLToPDF will not work as it is server-side functionality. 

To achieve this functionality we have created a preview button and we are calling javascript below which will open HTML in a new window of a web browser. From the New window, we will use chrome browser functionality to print PDF from HTML

<script>
  function preview() {
    alert("Preview");
  var w = window.open("","_blank", "width=auto,height=auto");
  var content = $("#toNewWindow").html();
   $(w.document.body).html(content);
  
  }  
 </script> 
<div id="toNewWindow">
    <p>Your content here </p>
</div>

The above code will open HTML inside <Div> in web browser new window

In the Web browser code is working fine but in Mobile app the code is opening in the web view. We want to disable web view of the application so that code will open in the chrome browser of mobile. Please suggest.

***Edited by Moderator: Pooja Gadige to add product details tag***
Pega Mobile Client 8 Pega Platform 8.3.2 Mobile Lead System Architect