HTML to PDF / DOCX / RTF Java converter library Forums PD4ML v3 Archived Forums (Read Only) Troubleshooting java.lang.NullPointerException – Not picking up CSS file

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #26463

    I have installed the pd4ml_demo.jar and it renders my HTML page correctly.
    However, the CSS file referenced as a link in the HEAD block does not seem to get applied. I get the following error:

    processing http://localhost:7070/BizFlowDemo/webapp/css/demo.css
    at com.steadystate.css.parser.SelectorListImpl.toString(SelectorListImpl
    at com.steadystate.css.parser.SACParser.selectorList(
    at com.steadystate.css.parser.SACParser.styleRule(
    at com.steadystate.css.parser.SACParser.styleSheetRuleList(SACParser.jav
    at com.steadystate.css.parser.SACParser.styleSheet(
    at com.steadystate.css.parser.SACParser.parseStyleSheet(
    at org.zefer.html.doc.d.d.Ê00000(Unknown Source)
    at org.zefer.html.doc.d.c.o00000(Unknown Source)
    at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
    at¶00000(Unknown Source)
    at$ Source)
    at$ Source)
    at Source)

    I have tried various combinations of changing the link href.
    I have used a file:/C:… as well as http://…..

    None seem to pick up the CSS.

    Can you give me any pointers based on this error?


    Obviously PD4ML successfully read the stylesheet, but CSS parser failed to interpret it. Could you please publish the stylesheet here or send it to support pd4ml com?


    Thanks for the response. I have been investigating further and I figured out that it was passing the CSS.
    I have cut down the CSS to just a couple of classes and it seemed to work.
    Is there an easy way for me to debug which CSS makes it fail?

    I have spotted one, FILTER statement for IE.

    Is there issues like browser specific styles used for progressive enhancements:

    -webkit-box-shadow: 4px 4px 3px #888;


    I have been going through trial and error and have resolved most issues of the CSS/HTML issues mentioned above.

    Can you confirm if the following HTML will be supported:

    2) P (Paragraph)

    These are important HTML to us.


    I have added example FIELDSET HTML + STYLES:


    Information Group


    .fieldsetGroup .fieldsetGroupLabelBackground, .fieldsetGroup .groupLabelBackground
    padding: 2px 10px 2px 10px;
    margin: 3px 3px 3px 15px !IMPORTANT;
    border: 1px solid #9bb8ea;
    background: url(../images/hsg_demo_theme/folder_tools_bg.gif) repeat-x left top;
    height: 18px;
    .fieldsetGroup LEGEND .label, .fieldsetGroupLabel
    font-size: 12px;
    font-weight: bold;
    color: #004677;

    Neither of these styles get applied in the PDF.

    Below is the paragraph styles that don’t get applied:

    Enter your rich text here


    /* PARAGRAPH – This is the actual P HTML element used */
    .main_body .form P, .main_body .form DIV.customControl
    font-weight : bold;
    color: #004677;
    line-height: normal;
    margin: 0px !IMPORTANT;
    padding: 1px 3px 1px 3px !IMPORTANT;
    vertical-align: top;

    Please see screenshots attached.


    Attached Document.


    Here you are faced with restrictions of PD4ML.

    1. PD4ML offers only a lightweight support of

    . It understands only text in it and ignores nested tag structures if any. You may apply text style and color to the legend text (addressing

    tag), but background colors and borders are going to be ignored.

    2. PD4ML allows to apply styles to . But

    tags are not a part of internal document structure tree, so they are not visible to CSS selector runtime. As a workaround you would need to remove .form from the CSS selectors.

    [language=css:lhug3mi0].main_body .form P, .main_body .form DIV.customControl
    font-weight : bold;
    color: #004677;
    line-height: normal;
    margin: 0px !IMPORTANT;
    padding: 1px 3px 1px 3px !IMPORTANT;
    vertical-align: top;

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

The forum ‘Troubleshooting’ is closed to new topics and replies.