You need to sign in to do that
Don't have an account?
mshn
Image Issue On Sites When Rendering As Pdf
Hi all,
We are working on a sites project and we need to show images on a pdf file. We could see the images on visualforce pages actually. But in sites, we can't see what we expect. Is there a specific way to handle this in sites?
Thanks.
Need some info
Images are stored as Attachments under Accounts right now but we can change them as Documents if it'd be necessary.
So few things I would like you to test
Something like that:
https://c.eu2.content.force.com/servlet/servlet.FileDownload?file=00Pb0000000vqDM
and this the method that we wrote in controller:
I tried but images didn't appear.
I think I'm going to give up this idea and try to find a new perspective for my output pdf file.
mshn,
There is a possibility that this is a bug. Please review the following post and see if it applies to your site. If so, it is a known issue and you should add yourself as an affected user. Unfortunately, if it is a bug, there is no workaround yet.
https://success.salesforce.com/issues_view?id=a1p30000000SvjLAAS
Force.com site that uses custom web address setup does not load static resource CSS when renders a VF page as PDF
VisualForce
Last updated Yesterday ·Reference W-1594833 ·Reported By 2 users
In Review
Summary
Unable to render a static resource or image if a VF page is rendered as PDF. The VF page is invoked from a custom web address that has a CNAME for force.com site.
Repro
- Use renderAs="PDF" in <apex:page> which includes static resource components.
- Exposed the page to the Force.com Site.
- Create a Custom Web Address for the Site.
- Try to access the page from the custom web address.
- The static resource does not render in the pdf
Workaround
- N/A
Thanks for reply Michael,
Instead of image tag, I used outputTextField to show image for now. Firstly, I added image as a new rich text custom field. The current problem is that I can't resize image file with css. Actually, it resizes the image on VF page but sites.com.