function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Puja Dev 6Puja Dev 6 

Formila field Images not showing on Render as PDF.

Hi All,

I have formula field of text datatype. It used to captured QR code of each Campaign Member Record.
On VFPage it's working fine.
But on Render as PDF, it shows currepted image.

Following is the formula field :
QR Code :
IMAGE('https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=MECARD://tjt--aresssbox.cs64.my.salesforce.com/'&Id ,'Scan QR code to open record in mobile.')
Best Answer chosen by Puja Dev 6
Puja Dev 6Puja Dev 6
Hi,
After adding following url.. i got the solution .
Add "https://chart.googleapis.com" to your remote site and check again.

Setup -> Remote Stie Setting add above URL.

All Answers

srlawr uksrlawr uk
I think the poblem here is probably that the "image" you are pulling is being generated based on the parameters on the URL that require the URL to be digested by a browser. Remember, the renderAs PDF attributes mean the page is drummed up on the Salesforce server, not in a browser, which is why Javascript, DOM manipulation and most CSS doesn't work. That isn't a reference to an image, but the concept of an image!

I'm not suprised that that URL doesn't work, I think the RenderAs PDF can only display static, publically accessible, direct images, nothing generated on the fly by external services..! I will have a play myself with some stuff and see if I can drum up a suggestion!
Puja Dev 6Puja Dev 6
Hi,
After adding following url.. i got the solution .
Add "https://chart.googleapis.com" to your remote site and check again.

Setup -> Remote Stie Setting add above URL.
This was selected as the best answer
srlawr uksrlawr uk
ahhh! sweet. good catch, and what a good point!
Abdulla d 5Abdulla d 5
i was stuck in the same problem, can u please post the code, i tried this it's not working. it shows as broken image
            <apex:column headerValue="QR code" style="width:150px;" >
                    <apex:outputText value="https://chart.googleapis.com/chart?chs=200×200&cht=qr&chl={!be.Qr_code__c}"  escape="false"/>
                </apex:column>