I have a visualforce page which renders PDF OK when viewing in Salesforce. However, the same page doesn't renders the styles in PDF when viewing through a Salesforce community site. Any idea what is going wrong with the PDF generation from community site?? The page is given below:
<apex:page renderAs="pdf" applyBodyTag="false"
showHeader="false" sidebar="false" standardStylesheets="false" >
<head>
<style>
.grad{
Width:600px;
Height:600px;
background: #0098d5; /* Old browsers */
}
#tst{
color:red;
font-size:60pt;
}
</style>
</head>
<body>
<div class="grad">
<span id="tst"> Hello Salesforce</span>
</div>
</body>
</apex:page>
Thanks.
<p>
tag (or table) and use a text align = center if that's what you're looking to accomplish. PDFs can be very finicky and work best with tables. Also, use an @media tag because the 800px won't be valid for print. – crmprogdev Mar 17 '17 at 14:26