You need to sign in to do that
Don't have an account?

Sites PDF Generation
Hi!
I have controller that returns a visualforce page as a pdf. It works in my development organization but when I installed it into my production organization it stopped working. It seems like it has something to do with the security settings since I get the site is down for maintenance message. Is there somewhere I can enable pdf generation for the public user? I couldn't see it in the site settings anywhere.
We might not be able to fix this in the short term. The issue related to going through caching (DE editions are not tied to caching so it works in these editions, as well as sandbox orgs)
Your only option is to use the secure url (which bypasses the caching) http://abc.secure.force.com for the pages that generates pdf for now.
*** 5/22/09 Update ***
We have the fix now. I'll update this posting when the fix is deployed to the production
*** 5/27/09 Update ***
The fix is part of Summer 09 release. If you have sandbox org with sites on CS0/CS2/CS3 then you can test the fix which is depoyed to these sandbox instances today.
All Answers
I tried to capture the guest user logs but it didn't show any errors, just success
The weird thing is that it depends on the context. If I try to generate the pdf from the website url it fails but if i'm logged into the salesforce account and enter /apex/pagename?pdf=1 it works fine. The other thing to note is that the contents of the page are identical in html and pdf mode and it displays fine in html mode.
I'm thinking there might be something funky going on since the page is part of a package.
I have noticed that if you have a reference to an sobjec that's part of a package in a page that's part of the same package that isn't in an apex tag it fails for example:
<apex:outputText value="{!CustomObject__c.CustomField__c}" />
works well
{!CustomObject__c.CustomField__c}
doesn't work unless you explicitely append the package namespace like this
{!stgcms__CustomObject__c.stgcms__CustomField__c}
We might not be able to fix this in the short term. The issue related to going through caching (DE editions are not tied to caching so it works in these editions, as well as sandbox orgs)
Your only option is to use the secure url (which bypasses the caching) http://abc.secure.force.com for the pages that generates pdf for now.
*** 5/22/09 Update ***
We have the fix now. I'll update this posting when the fix is deployed to the production
*** 5/27/09 Update ***
The fix is part of Summer 09 release. If you have sandbox org with sites on CS0/CS2/CS3 then you can test the fix which is depoyed to these sandbox instances today.
Awesome, thanks!
:)
For some reason the PDF generation is still not working for our production organization. It works perfectly in the Sandbox environment but not in the Production environment
Scott
Scott,
Seems like if the page has static resources then we have the issue. If you have a different case please let me know.
We have the fix ready and we will deploy it to the production soon. I'll update the post once it's deployed.
I tried to use the secure url as a temporary fix however I'm experiencing some weird behavior. If I click the pdf link from the public page then the page returns a file not found error. If I then copy the url into a new window or just put my cursor into the address bar and click enter it returns the PDF as expected. For example if you go to the following url:
https://stantive.secure.force.com/apex/stgcms__StantiveArticle?name=Cloud-Computing-Explained&pdf=1
you get the expected pdf
if you click a link on the site with the exact same url it returns file not found.
Very odd :)
Scott
Thanks,
It does work now.
Cheers,
Scott