How to Resolve Iframe Scroll issue for PDF in Lightning for IPAD in Salesforce 1?

So I had one of the Requirements where I had to generate PDF through VF page and Open that on Click of Quick action. But I was facing an issue that scroll for the PDF was not Working. My PDF had 4 pages and In case of IPAD, the scroll was not working. After trying too many things Final workaround that I found was using window .open.

testPDF.cmp

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
	<!-- Defining Handler -->
<aura:handler name="init" value="{!this}" action="{!c.doInit}" description="" />
<!-- Defining Attribute -->					
<aura:attribute name="URL" type="String"  default="" /><aura:attribute name="pageId" type="String" default= "{!v.URL + '/apex/TestPdfVFpage?id='}"/>	
 </aura:component>

testPDF.js

({
   doInit  : function(component, event, helper) 
    {
   const values =  $A.get("$Label.c.Base_URL_VF");
   component.set('v.URL', values);
   var recordId = component.get("v.recordId");
   window.open(values + "/apex/TestPdfVFpage?id="+recordId,"_self");
    }
})

Hope this help you 🙂

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s