Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #27054


    We are using PD4ML 3.9.2 library for converting HTML documents to PDF. We have a requirement to validate the CSS Styles in HTML document before converting the same to PDF.

    We have been using the CSSSOMParser (from cssparser 0.9.17 jar) earlier to validate the CSS present in the HTML content.

    But since PD4ML uses ss_css2 3.9.2 , we ended up replacing the existing CSS jar i.e cssparser 0.9.17 with the ss_css2 3.9.2 due to jar conflicts.

    The CSSSomParser in cssparser 0.9.17 provides a ErrorHandler that can be used to validate the CSS which is not available with CSSSomParser in ss_css2 3.9.2 library.

    Could you please let me know if there are any plans of upgrading ss_css2 to use the latest cssparser jar OR are there any workaround that we can achieve validation of CSS styles in HTML using PD4ML 3.9.2




    Any update on the above issue?



    I would recommend just to enclose your CSS style with HTML tags:



    If it is a standalone CSS stylesheet, refer to it with tag from a minimalistic HTML as above.

    Pass the HTML to PD4ML in debug mode. PD4ML will dump to STDOUT all CSS syntax issues it detected.


    [On behalf of sameera]

    Thanks for the reply. We are able to see the warning message for incorrect css stylings in DEBUG mode on the STDOUT.

    But, we are looking for means to get the validation errors as part of either exception or some means of handler callback so that we can capture and show it to the end user on UI. Please let me know if you have any suggestions or approaches to achieve the same.



    We could add the reporting only to the forthcoming v4.0 or PD4ML (not expected before October-November 2016).

    We do not plan to extend the current PD4ML v3.9.9 with new features. However we could add a prefix to all CSS diagnostics messages, so you’ll have a possibility to filter them from PD4ML’s output and show it to users if needed.

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.