When using custom buttons in partner community and Salesforce internal, you need to check the following:

  1. Make sure the community user is an assigned RS Documents user.
  2. Make sure any community you are using is ACTIVE and PUBLISHED. This will make the community domain active.
  3. Make sure your custom button is both on Classic layout and community page layout.
  4. Then Modify Button Code:

You need to modify button code to include “{!URLFOR($Site.Prefix + ‘/” at the beginning of the button code that is showing at bottom of document action.

Example of original button code in Document Action:
/apex/rsdoc__GenerateDocument?id={!Lead.Id}&templateId=GDT-000004&attach=true&output=pdf&emailAction=autosend&emailTo={!Lead.Id}&emailTemplate=00X28000001SwGo

Example of how to change button code to work with Partner Community: 
{!URLFOR($Site.Prefix + ‘/apex/rsdoc__GenerateDocument?id=’ + Lead.Id + ‘&templateId=GDT-000004&attach=true&output=pdf&emailAction=autosend&emailTo=’ + Lead.Id + ‘&emailTemplate=00X28000001SwGo’)}

This button format needs to be used in communities and salesforce internal to avoid URI mismatch error message. Salesforce article showing this is common issue with these types of org’s: https://developer.salesforce.com/forums/?id=906F000000099IfIAI.