You need to sign in to do that
Don't have an account?
p1_dfs
How to display image from document folder in VF PDF page
We are creating a PDF document using Visual Force Page and the document has a logo ( a png or gif image file on header). Currently the image file is a static resource and using merge field the VF page is able to display it correctly. When we do the packaging the resource is also packaged and is getting installed without any issues.
Now we want to change the logo at the installed org , as the logo was bundled as static resource it cannot be modified so, we are trying to place the image in a document folder and refer it in VF page but the image is not displaying correctly . We have tried using url for the image but it is not working . Your help or a working example will be appreciated in resolving this issue.
<apex:image value="{!$Resource.gii__logo}"/>
We are trying to package the application as managed beta. The static resources gets locked in the target org.
So we are not able to change the logo.
Is there any way we can use a logo file from the document folder in
We already tried using the URL <apex:image url="/document/image/logo.jpg"/>. But it does not work..
Is there any way to get the URL for the documents within the org itself.
**This is very urgent, ** Your help is much appreciated
Now we want to change the logo at the installed org , as the logo was bundled as static resource it cannot be modified so, we are trying to place the image in a document folder and refer it in VF page but the image is not displaying correctly . We have tried using url for the image but it is not working . Your help or a working example will be appreciated in resolving this issue.
<apex:image value="{!$Resource.gii__logo}"/>
We are trying to package the application as managed beta. The static resources gets locked in the target org.
So we are not able to change the logo.
Is there any way we can use a logo file from the document folder in
We already tried using the URL <apex:image url="/document/image/logo.jpg"/>. But it does not work..
Is there any way to get the URL for the documents within the org itself.
**This is very urgent, ** Your help is much appreciated
Maybe the following article can shed some light...
Message Edited by okaylah52 on 09-04-2008 07:17 PM
How about this... (haven't tried if this really works..):
1. In dev sandbox, create a static resource that contains the logo file name and path. Do the same in the production, but with different content/logo name and path.
2. Your programs retrieves the static resource, reads the content (assign to your controller/extension class), then retrieves the correct logo.
Message Edited by okaylah52 on 09-05-2008 01:45 AM
How about this... (haven't tried if this really works..):
1. In dev sandbox, create a static resource that contains the logo file name and path. Do the same in the production, but with different content/logo name and path.
2. Your programs retrieves the static resource, reads the content (assign to your controller/extension class), then retrieves the correct logo.
Can you please Give some example how I can read the contents of statci resource from control and how to use it in the VF Page
1. Create a new Saleforce document, e.g. "bandoneon.jpg".
2. Go to the detail page of the document. Near the "keyword" line, you should see "Click here to view the file". If you hover your mouse pointer of it, you should see the URL, something like "https://na5.salesforce.com/servlet/servlet.FileDownload?file=01570000000toA8". Right-click (assuming you are using MS Windows) the URL then select "Copy link location"
3. In your VF page, write something like...
Please note that I've removed "https://na5.salesforce.com" because this is fixed URL and I want to use relative URL.
Hope this helps.
you may try this, it should work
controller:
getmyimageurl () {
document doc = [ query the document table for the image by exact name limit 1]
string imageid = doc.id;
imageid = imageid.substring(0,15);
return '/servlet/servlet.FileDownload?file=' + imageid;
}
when I get image url the following way, the image is not showing on the sites/portal page? Other part of the page are properly displayed including an image from static Resource?
<apex:image url="{!myimageurl}" />
image setting is public public -> Externally available is checked. Image gets displayed properly when I am logge-in?
What other setting do I have to change?
Thanks Bob Buzzard, your solution of using document storage was just the bump I needed. Very elegant solution until static resources can be made editable to package subscribers.
You need to make the document folder with public access