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
IanM1963IanM1963 

renderAs PDF and Amazon image store

Hi,

 

I can find plenty of places where static resources are used to house images for VisualForce pages which are then rendered as pdf no problem. However, has anyone tried using a URL field in a custom object when that URL points to an Amazon S3 storage?

 

This is my VF page at the top...

 

<apex:page standardStylesheets="false"   standardController="pb__InventoryItem__c" renderAs="pdf" >

<apex:variable var="inv" value="{!pb__InventoryItem__c}"/> 

 

You can see I'm creating a variable so I can access various fields from my custom object...

 

Just one of the image tags here...

 

<apex:image url="{!inv.pb__Image1__c}" width="100%" height="425px" />

 When I let it render as HTML all images appear no problem. The URL that is returned is ok and everything works until I renderAs PDF and the images break. Is there any way around this? I can't see creating static resources for every image as being a solution. Especially as there is everything in the S3 storage area. All I need to do is to be able to render out to PDF!

 

Also, does anyone know if it's easy enough to render a Google map out to PDF from a VF page?

 

Thanks in advance. I'd really appreciate any help as this is quite an urgent job. Very frustrating when you have got the page working apart from rendering to PDF.

 

Regards,

Ian

 

Best Answer chosen by Admin (Salesforce Developers) 
IanM1963IanM1963

It seems I have fixed my own issue! Didn't realise that there is such as thing as Remote Site Settings.

 

Go to Setup > Security Controls > Remote Site Settings and add the url for teh remote image store which in this case was Amazon S3.

All Answers

IanM1963IanM1963

It seems I have fixed my own issue! Didn't realise that there is such as thing as Remote Site Settings.

 

Go to Setup > Security Controls > Remote Site Settings and add the url for teh remote image store which in this case was Amazon S3.

This was selected as the best answer
SjaleelSjaleel

I have done the same to access an image into our PDF file,

 

Created a field type of URL in my custom object page and this is my tag for the image

 

<apex:image url="{!parentAC.Logo__c}" width="25%"/>

 

When to the remote Site Settings and added the url where the image is saved, it's in Picasa public album

 

but I get a broken link for the image, could you help me what might be wrong?

 

 

Thanks and regards

S.Aj

siva.valgen@valgen.comsiva.valgen@valgen.com
if it's easy enough to render a Google map out to PDF from a VF page?