I have been trying to display PDF content in a new tab using ui:outputURL. It's not working by clicking, but working by "Open link in new tab".


<aura:application extends="force:slds" controller="CCGComponentControllerPC">
<aura:handler name="init" value="{!this}" action="{!c.testPdfHandler}" />

<ui:outputURL aura:id="oURL" value="" label="Test Pdf" target="_blank" />

Controller :

testPdfHandler : function(component, event, helper) {
    var data = response;
    var blob = new Blob([data], {type: "application/pdf"}),
        url = window.URL.createObjectURL(blob);

    var oURL = component.find("oURL");
    oURL.set("v.value", url);
    oURL.set("v.label", url);

Is there any workaround for this issue?

  • did you find any solution? Thanks! – Ismael Slimane Jun 28 '18 at 10:30
  • Yes can you update if this is solved ? – SFDC Apr 17 '19 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.