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
sc12345sc12345 

VF page with renderas=pdf fails when accessed via sites on production

I have a VF page (called prodinfo ). 

 

On Sandbox

- Accessing as regular VF page (URL looks like http://xxxxx/apex/prodinfo)

- - - HTML version output - works fine

- - - PDF version output (by just adding 'renderas="pdf" in the page tag) - works fine

 

- Accessing as Sites page (after setting up a site to refer to this page. URL looks like http://xxxxx.force.com/prodinfo)

- - - HTML version output works fine

- - - PDF version output (by just adding 'renderas="pdf" in the page tag) - works fine

 

On Production

- Accessing as regular VF page (URL looks like http://yyyyy/apex/prodinfo)

- - - HTML version output - works fine

- - - PDF version output (just by adding 'renderas="pdf" in the page tag) - works fine

 

- Accessing as Sites page (after setting up a site to refer to this page. URL looks like http://yyyyy.force.com/prodinfo)

- - - HTML version output (regular page tags etc.) works fine

- - - PDF version output (just by adding 'renderas="pdf" in the page tag) - FAILS with the dreaded InMaintenance error.

 

There is not change to code other than to add and remove the renderas clause.

 

As soon as I remove the renderas="pdf" part on the page, the VF page on production accessed as a Sites page shows up fine.

 

Any help / information / pointers greatly appreciated.

 

Thanks

SC

Idd BaksheeshIdd Baksheesh

Something to do with the permission, check the sites guest profile permission are same as that of sites. This happens most of the times, nothing to do with renderas, the profile permission is the culprit.

joshbirkjoshbirk

Agreed - if a normal producation user can see it, and the Sites Guest Profile cannot, that's almost always the culprit. 

sc12345sc12345

Thanks for the pointer.

 

However, with no other profile / permission changes, if I just remove the 'renderas="pdf"' in the page tag, the same page can be accessed as a sites page. It shows up perfectly as expected via URL link. So permissions as they are set now, seem to be working fine if accessed without rendering as pdf.

 

Not sure if 'renderas' requires any additional permission settings.  

 

Any thoughts?

 

Thanks

SC

BeeddiskShahBeeddiskShah

The best thing what you can do right now, is compare the guest profile in sandbox and in production. There must be some checkbox checked or unchecked. Don't compare it with other profiles in productions.

BeeddiskShahBeeddiskShah

Damm it why does my picture change when I login from home? o.O

jwetzlerjwetzler

Doesn't sound like a permissions issue if the page works fine for a sites user when it's rendered as HTML, but the same page doesn't work with the same user when rendered as a PDF.  I'd open up a case with support.