I am using the below css . this works fine in html but when i do renderAsPdf this doesnt work.
p {
-webkit-columns: 2;
-webkit-column-gap: 5mm;
-webkit-column-rule: dotted green 1mm;
}
I've found that styles declared in external resources or inside tags don't always get picked up correctly by the PDF rendering engine. HTML tables are particularly flaky in this regard, so I typically end up using inline styles.
However, in this case I don't think that's the issue. The style that you are defining relies on the webkit attributes, which are styles specific to the webkit rendering engine (used by Safari and previously by Chrome). As the Salesforce PDF rendering engine doesn't use webkit, those attributes will be ignored. The only way I've found to get these type of extended CSS attributes into PDF is to load the page in chrome and then print to PDF.