Skip to main content
I have taken an example to create a PDF from an LWC.  From an LWC component I am calling an Aura enabled class.  That class passes the HTML using a variable to a visualforce page that renders as a PDF.

In my own development org, I am getting the expected results.  However, when I use the exact same code in another sandbox, I am getting a null PDF.  I put a debug in the controller for the visualforce page.  The debug does not post in the code that is not working. Therefore, it seems that my pagereference is not working.

As I mentioned, the exact code is working in my development org, just not in the sandbox that I copy it to.  Any suggestions on why that woudl happen?  thanks!!!
4 answers
  1. Dec 14, 2022, 8:57 AM
    put "oauth_token" as a param to the page reference.

    page.getParameters().put('oauth_token', userinfo.getSessionId());

    This should work.

     
0/9000