<< back
PD4ML: Proprietary CSS featuresAs you know, PD4ML supports rendering/conversion of CSS-styled HTML documents. However we never claim that PD4ML is CSS2 or CSS3 compliant. There are some CSS features, whose implementation we decide to skip due to technical complexities or potential performance issues; there are some features we ignored as they are not that popular (from our perspective); some features are not supported by our CSS parser.FYI: PD4ML utilizes a third-party library ss_css2.jar of open-source CSS Parser project. The library "officially" supports CSS Level 2, that makes an implementation of highly demanded popular CSS3 features complicated, or even impossible. We patched the library to workaround some limitations, however there is still a number of open issues. (The patched source code of the library is available for download from our site). By the link you can find the list of currently supported CSS properties. As you may see the list ends with some non-standard PD4ML-specific properties. Below we'll try to shed light on them. But first, we start with supported CSS media types and a proprietary type 'pdf'. 1. Media type 'pdf' By default PD4ML applies CSS properties, defined for media type 'screen' (if a media type specified). Of course, it also applies styles of media type 'all', but 'print' is ignored. If for some reason print styles must be applied, PD4ML allows to enable them with the API call: Map m = new HashMap(); m.put(PD4Constants.PD4ML_MEDIA_TYPE_PRINT, "add"); pd4ml.setDynamicParams(m);The above code enables 'print' media type in addition to 'screen'. If 'screen' styles are undesired, the following disables 'screen' and enables 'print'. Map m = new HashMap(); m.put(PD4Constants.PD4ML_MEDIA_TYPE_PRINT, "override"); pd4ml.setDynamicParams(m);In situations, when very special styles are required for pdf conversions only, there is a proprietary media type 'pdf'. As the type is known to PD4ML only, it will be ignored by the regular web browsers.
@media pdf { TR, IMG {page-break-inside: avoid;} }CSS media queries are not supported. 2. Proprietary CSS properties
PD4ML supports most of CSS2 selectors including some popular CSS3 constructs. Here is the list.
The selectors can be combined or chained.
|