2

When user clicks on a quick action, a soap webservice callout is made and in response we get base 64. I need to convert this base64 into PDF and display it online. I dont want to save the pdf document anywhere. Directly display it as PDF. Any help will be appreciated.

I referred code from below link but when I paste the base 64 i get from response of webservice it does not work and I get error that Failed to load the pdf document: Pasting the code here https://developer.salesforce.com/forums/?id=906F0000000Ax5sIAC

1) create a Visualforce page called HelloWorld:

<apex:page controller="DownloadPDF" sidebar="false" showHeader="false" contentType="application/pdf">
    <script>
        window.location.href = "data:application/pdf;base64,{!match1}"; // switch between match1,match2
    </script>
</apex:page>

2) create the controller DownloadPDF

public class DownloadPDF {
// Option 1: use an example PDF document base64 string 
    public String getMatch1() {
        string s = 'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwog' +
  'IC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAv' +
  'TWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0K' +
  'Pj4KZW5kb2JqCgozIDAgb2JqCjw8CiAgL1R5cGUgL1BhZ2UKICAvUGFyZW50IDIgMCBSCiAg' +
  'L1Jlc291cmNlcyA8PAogICAgL0ZvbnQgPDwKICAgICAgL0YxIDQgMCBSIAogICAgPj4KICA+' +
  'PgogIC9Db250ZW50cyA1IDAgUgo+PgplbmRvYmoKCjQgMCBvYmoKPDwKICAvVHlwZSAvRm9u' +
  'dAogIC9TdWJ0eXBlIC9UeXBlMQogIC9CYXNlRm9udCAvVGltZXMtUm9tYW4KPj4KZW5kb2Jq' +
  'Cgo1IDAgb2JqICAlIHBhZ2UgY29udGVudAo8PAogIC9MZW5ndGggNDQKPj4Kc3RyZWFtCkJU' +
  'CjcwIDUwIFRECi9GMSAxMiBUZgooSGVsbG8sIHdvcmxkISkgVGoKRVQKZW5kc3RyZWFtCmVu' +
  'ZG9iagoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4g' +
  'CjAwMDAwMDAwNzkgMDAwMDAgbiAKMDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAw' +
  'MDAwIG4gCjAwMDAwMDAzODAgMDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9v' +
  'dCAxIDAgUgo+PgpzdGFydHhyZWYKNDkyCiUlRU9G';
        return EncodingUtil.base64Decode(s).toString();
    }
}
1

I have had the same requirement recently. You can just use <object> tag with data argument that contains your Base64 string:

<apex:page id="PDFPage" controller="YourController" showHeader="false" sideBar="false">
    <object data="data:application/pdf;base64,{!base64String}"></object>
</apex:page>
| improve this answer | |
  • Thanks for your response. How can we achieve the same thing with the help of lightning component? – user42184 Nov 26 '19 at 13:27
  • @user42184 I just embedded this VF page into a Lightning component with an iframe: <iframe src="{! '/apex/PDFPage?recordId=' + v.recordId}" width="100%" height="700px" frameBorder="0"/> – Novarg Nov 26 '19 at 13:57
0

You can use this Simple Lightning Component by KK Ramamoorthy to render the PDF from Base64 String inside Lightning Experience. This component uses the PDF.JS library and is very simple to use. You can either deploy the package directly or create the pdfViewer component manually.

Here is an example on how to use this pdfViewer component inside another Lightning Component.

pdfViewerExampleComponent.cmp

<aura:component implements  = "flexipage:availableForAllPageTypes,force:appHostable">
    <aura:attribute name="pdfContainer" type="Aura.Component[]"/>
    <lightning:overlayLibrary aura:id="overlayLib"/>
    <lightning:button label="Popup" onclick="{!c.showPDFInPopup}"/>
    <lightning:button label="Inline" onclick="{!c.showInlinePDF}"/>
    {!v.pdfContainer}    
</aura:component>

pdfViewerExampleComponentController.js

({
    showPDFInPopup : function(component, pdfData) {
        var pdfData = 'JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAF9UsFOxCAQvfMVT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E3ODljN2FmNzM+IF0gPj4Kc3RhcnR4cmVmCjc1MDEKJSVFT0YK';               
        $A.createComponent(
            "c:pdfViewer",
            {
                "pdfData": pdfData
            },
            function(pdfViewer, status, errorMessage){
                if (status === "SUCCESS") {
                    component.find('overlayLib').showCustomModal({
                        cssClass: "slds-modal_medium",
                        header: "PDF Viewer",
                        body: pdfViewer, 
                        showCloseButton: true,
                        closeCallback: function() {
                        }
                    })                    
                } else if (status === "INCOMPLETE") {
                    console.log("No response from server or client is offline.")
                } else if (status === "ERROR") {
                    console.log("Error: " + errorMessage);
                }
            }
        );      
    },
    showInlinePDF : function(component, pdfData) {
        var pdfData = 'JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAF9UsFOxCAQvfMVT60u1S0FCkt71XjxtgmJB9dTsx5M1mTt/ycOFFi7cQ2HGWYe7w0PjtjiiIGWHQycM/je4xVfaJ8mhXGCjGsaCSWFNvM+JE6JvoeTvdhgPODRMztjU/AHtN5rKPgPvIFf1Wik6MCva2Iy4DexoMCr25zdpdaqZoTV4DseWxa8YHZ1AmWe+wghwoec5E6CsiJZEIWtWudDhbeJFRpU5FYbFKmwjmORUjkuI4TGUzk5YcN1CVuV+QomVRjPYOJ7h3/Bs4/PsTRaW3LaSvfb68AtpSRvRyxsZ+e266YzNBvZ3ARZiuTOP2KDE844PYux+LBLBZwrlPtVNvn0d2Sc6peVO+3ERoWPdfpSl5QZfanwCP5ztmz7Ayq1hQQKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjI5MwplbmRvYmoKMiAwIG9iago8PCAvVHlwZSAvUGFnZSAvUGFyZW50IDMgMCBSIC9SZXNvdXJjZXMgNiAwIFIgL0NvbnRlbnRzIDQgMCBSIC9NZWRpYUJveCBbMCAwIDYxMiA3OTJdCj4+CmVuZG9iago2IDAgb2JqCjw8IC9Qcm9jU2V0I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zc1NiAwMDAwMCBuIAowMDAwMDA0MTc5IDAwMDAwIG4gCjAwMDAwMDQ0MzUgMDAwMDAgbiAKMDAwMDAwNzA1OCAwMDAwMCBuIAowMDAwMDA3MDc5IDAwMDAwIG4gCjAwMDAwMDcxMDcgMDAwMDAgbiAKMDAwMDAwNzE2MCAwMDAwMCBuIAowMDAwMDA3MjAzIDAwMDAwIG4gCjAwMDAwMDcyMjIgMDAwMDAgbiAKMDAwMDAwNzI0NSAwMDAwMCBuIAowMDAwMDA3Mjg3IDAwMDAwIG4gCjAwMDAwMDczMDYgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSAyNiAvUm9vdCAxMiAwIFIgL0luZm8gMSAwIFIgL0lEIFsgPDYwZTFmNDQ5OTI1ZDBjNDYwM2Y3ZGJhNzg5YzdhZjczPgo8NjBlMWY0NDk5MjVkMGM0NjAzZjdkYmE3ODljN2FmNzM+IF0gPj4Kc3RhcnR4cmVmCjc1MDEKJSVFT0YK';               
        $A.createComponent(
            "c:pdfViewer",
            {
                "pdfData": pdfData
            },
            function(pdfViewer, status, errorMessage){
                if (status === "SUCCESS") {
                    var pdfContainer = component.get("v.pdfContainer");
                    pdfContainer.push(pdfViewer);
                    component.set("v.pdfContainer", pdfContainer);                    
                } else if (status === "INCOMPLETE") {
                    console.log("No response from server or client is offline.")
                } else if (status === "ERROR") {
                    console.log("Error: " + errorMessage);
                }
            }
        );      
    },    
})

Screen Grab: enter image description here

| improve this answer | |
  • Saroj I tried your approach and installed the package but I am getting below error. I have removed the hardcoded base64 and referred the method from my controller as below. Error received on testing: Error: Failed to execute 'postMessage' on 'Window': function(o,n){const i="modal",e="panel";function t(o){const n=parseInt(o,10);return isNaN(n)?0:n}class s{constr...<omitted>...)} could not be cloned. Also getting below error This page has an error. You might just need to refresh it. [Error in $A.getCallback() [Cannot read property 'setParams' of undefined]] – user42184 Nov 27 '19 at 8:45
  • How you are calling these (showPDFInPopup or 'showInlinePDF') methods? You have to call these methods inside the action.setCallback from your action method (where you are getting the PDF String) by passing the PDF string as a method parameter. – Saroj Bera Nov 27 '19 at 10:33

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.