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
Ilene JonesIlene Jones 

SDocs images not showing when image is from an external source ie: Box

We are using SDocs with images hosted in Box due to image size constraints.  We are having an issue where the PDF renders VERY quickly, however the images which are hosted on Box do not have time to render before the PDF creation is complete.  Is there a way to slow down the PDF creation process to ensure that the images are rendered prior to the PDF finalization?

This was working for about 2 months, however we're back to this issue after Summer '14 release.  We did find a whitelist issue that was resolved, so the images are not broken, however they also do not show up.

We've updated to SDocs Winter '15 in our sandbox (we do not have a Salesforce Winter '15 instance this time), however that does not solve the issue.  In addition, we're using direct links (non-redirected) to ensure that the images are loaded as quickly as possible.

Hargobind_SinghHargobind_Singh
Hi

Am not sure if this would resolve your problem, but in the past I've faced issue where external images were not showing in rendered PDFs, the images were being taken from a single domain, and adding that domain to "Remote Sites" resolved the problem. At that time Salesforce reasoned that PDF generators are separate servers and security is tight, so they can't access images unless the domain is allowed via Remote Sites. 


Ilene JonesIlene Jones
The whitelist issue I mentioned was adding the new subdomain to "Remote Sites", however that did not completely solve the issue.  The images are not broken links at this point, they are just not showing up at all - blank area where the images should be.
Hargobind_SinghHargobind_Singh
Hi

Are you images showing up if you don't use renderAs PDF ? 
Ilene JonesIlene Jones
Yes, under normal circumstances the images show up.  We have them linked through a rich text field and they show just fine in that field, however do not show up when they are rendered as a PDF using SDocs.  We are going to create a test Visual Force page which will use the images and render either as a PDF or as a VF page to see if this will shed more light on the issue.  We believe this may have to do with the changes to the PDF rendering engine that were made with Summer, but have nothing to substantiate that yet.
Admin OneAdmin One
Hi Ilene, 

Have you tried adding the field directly in the Code of the Template? This is what we've done. We've actually placed our ULR that leads to the picture (stored in the Documents Folder) in a formula field and referenced it like this: 

<td valign="top"><img alt=" " src="{{!OBJECT.FORMULA__c}}" width="400" />

User-added image

 
Matt Higgs 5Matt Higgs 5
Any luck getting the Box images to show up.  Is it the redirect or load-time causing the issues?

When outputting as web page, shows up fine.  When rendering as PDF, the images don't show.
 
scottbcovertscottbcovert

Old post, but I ran into this as well and thought I'd share the resolution.

When the template editor is used to upload the images the URL generated for use within the template will look like this:

https://[myDomain]--sdoc.visualforce.com/servlet/servlet.ImageServer?id=[imageId]&amp;oid=[orgId]

This URL is valid and works when previewing the template, but the image won't render within a PDF even after adding https://[myDomain]--sdoc.visualforce.com as a remote site setting.

Instead the following URL should be used as the src attribute within the image tag included in the template.

https://[myDomain]--c.documentforce.com/servlet/servlet.ImageServer?id=[imageId]&amp;oid=[orgId]

Note the different domain - which also means you'll have to update your remote site setting accordingly to avoid broken images.