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
maddukurimaddukuri 

Static resource that has multiple pages

Hi,

 I have a static resource that has multiple pages and when I reference it in the page using,

 

<apex:imageurl="{!$Resource.GPONovationRMW60}"width="100%"height="900px"/>

 

only the first page is displayed. The 2nd page in the static resource doesn't show up. Can we render fully, the static

resources that has multiple pages?  Any input is appreciated.

 

Thank You!

Best Answer chosen by Admin (Salesforce Developers) 
maddukurimaddukuri

The tiff gets rendered in  the VF page if it is a single page. So, broke the multi page tiff into single pages and included them separately in the VF page. Thanks much for your time though!

All Answers

bob_buzzardbob_buzzard

Is this resource a zip file, or is it simply an image as you are using it?

maddukurimaddukuri

It is simply an image. It is of type image/tiff.

bob_buzzardbob_buzzard

Is it maybe because you have limited the height of the image to 900px?

maddukurimaddukuri

Tried increasing/decreasing the height and width, but didn't work.

colemabcolemab

If you open the file locally in your browser, does it display mutiple pages?

 

In otherwords, is the issue that the browser won't render mutiple pages?   This is opposed to say salesforce not serving up the mutiple pages.

maddukurimaddukuri

 I can view all the pages when I view the file(static resource) in my browser.

colemabcolemab

Sorry but i just realized that a direct open wasn't a fair test.  Please make an Html file in the same dir on your hard drive as the tiff image.  In that file, mimic your vf code in html by using the code kind of like this (but matching your VF settings):

<html>
<body>

<img src="my.tiff" width="100%" height="900px>

</body>

<html>

 

Now does the tiff render all pages?  If so the issue is with VF.  If not, the issue is with the browser.  If it is a browser issue, perhaps an Iframe would work?

maddukurimaddukuri

The tiff doesn't render at all when I put in the html file. I am not sure if changing it to gif/jpeg makes a difference. But will try.

colemabcolemab

I did some research for you and found this link, which indicates that most browsers can't/won't render a tiff image.

 

The issue is with the browser, not visual force.

maddukurimaddukuri

The tiff gets rendered in  the VF page if it is a single page. So, broke the multi page tiff into single pages and included them separately in the VF page. Thanks much for your time though!

This was selected as the best answer
colemabcolemab

Anytime.  Glad you got it working!