You need to sign in to do that
Don't have an account?
VPd
Render visualforce as PDF from Apex. View State Limit issue.
Hi All,
I have a visualforce page to render as PDF. This page has few images with total size as 5MB but it throws view state limit exception. The salesforce documention says "The maximum total size of all imagesincluded in a generated PDF is 30 MB". I don't have any controller variable(dynamic values) to show on the page. it all has static text, CSS and images.
Not sure why this view state limit hits given that the salesforce allows total image size as 30MB and imanges to show in my case is just 5MB. Any help or pointer on this would be greatly appreciated.
Thanks,
I have a visualforce page to render as PDF. This page has few images with total size as 5MB but it throws view state limit exception. The salesforce documention says "The maximum total size of all imagesincluded in a generated PDF is 30 MB". I don't have any controller variable(dynamic values) to show on the page. it all has static text, CSS and images.
Not sure why this view state limit hits given that the salesforce allows total image size as 30MB and imanges to show in my case is just 5MB. Any help or pointer on this would be greatly appreciated.
Thanks,
Salesforce allows Visualforce pages to have a maximum view state size of 135KB.
The View State tab shows you which elements on your page are taking up that space.
A smaller view state size generally means quicker load times.
In order to avoid this error, minimize your pages' view state. You can optimize your Apex controller code and remove any superfluous Visualforce components used.
For example:
If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions, consider refining your SOQL calls to return only data that's relevant to the Visualforce page.
If your view state is affected by a large component tree, try reducing the number of components your page depends on.
For more information regarding the View State read page 21 of the developer guide.Salesforce allows Visualforce pages to have a maximum view state size of 135KB.
The View State tab shows you which elements on your page are taking up that space.
A smaller view state size generally means quicker load times.
In order to avoid this error, minimize your pages' view state. You can optimize your Apex controller code and remove any superfluous Visualforce components used.
For example:
If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions, consider refining your SOQL calls to return only data that's relevant to the Visualforce page.
If your view state is affected by a large component tree, try reducing the number of components your page depends on.
For more information regarding the View State read page 21 of the developer guide.
Reference : https://help.salesforce.com/articleView?id=000002955&type=1
Please let me know if it helps.
Thanks.
Thanks.