Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;
share|improve this question

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.

share|improve this answer
Hi Bob. it doesnt work in print as well.. My requirement is that I need to render a vf page as pdf . And there is dynamic content in the vf i want it to break the content based on the columns defined in the CSS . I am using chrome engine. without webkit it doesnt work in vf page as well – user3804526 Jul 22 '14 at 11:03
I reckon you'll have to use an HTML table for this - the PDF rendering engine in Visualforce is pretty basic. – Bob Buzzard Jul 22 '14 at 11:14
In that case i wont be able to decide when the page is about to break and I have to move the content to the 2nd column and not to 2nd page. because its dynamically generated content – user3804526 Jul 22 '14 at 11:19
Unfortunately, stating your requirements doesn't change the capabilities of the underlying tool, you have to work with what the PDF engine can do. – Bob Buzzard Jul 22 '14 at 11:20
Any suggestions in using HTML table to determine the size of the PDF page so that as soon as that height is reached i can shift the content to the next column – user3804526 Jul 22 '14 at 11:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.