1

Even though Salesforce provides supports for CSS3 via render as="pdf" attribute. To print the documents we need to make use browser print functionality. Almost all the browsers are not supporting many of the CSS3 properties. An alternative to them is 'FlyingSaucer' library , which supports all the CSS3 styles. But as far I have seen 'FlyingSaucer' is a java library.So Is it possible to include FlyingSaucer library in Visualforce pages?

1

Even though FlyingSaucer is a Java library it do support some CSS properties. You can use them wherever you want. Read this guide for complete understanding Flying Saucer Guide

In the Flying Saucer guide View this topic "Flying Saucer Extensions to the CSS". It might help you.

3

In fact, Salesforce is already using Flying Saucer. However they have not kept it up to date, so effectively you are stuck only being able to use styles and elements that existed before HTML5/CSS3. So whatever you're trying to do, you need to do it "old-school". I find doing Visualforce PDF layouts requires lots and lots of tables.

And no, you cannot execute arbitrary Java libraries on Salesforce's servers.

I'm not sure what you're saying about browser print functionality. If you use the standard renderAs="pdf" attribute and generate a PDF, the client can print that PDF with their browser. Are you looking for something else?

There is a pilot for a Chromium-based Advanced PDF: https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_vf_advanced_pdf.htm Information about it is scarce. You can try contacting Salesforce if you're interested.

0

FlyingSaucer it is not officially supported by Salesforce and they do not recommend use it. This is their answer in a support case I have raised recently regarding this library:

"Officially , the method which is working for you now " -fs-table-paginate" is not documented anywhere in SFDC so we cannot guarantee you that it will work in future and might break."

I have created an Idea so that Salesforce document and officially support the library:

https://partners.salesforce.com/ideaView?id=0873A000000lKdPQAU

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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