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
    Posts
  • #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
    java.lang.NullPointerException
    at com.steadystate.css.parser.SelectorListImpl.toString(SelectorListImpl
    .java:57)
    at com.steadystate.css.parser.SACParser.selectorList(SACParser.java:1188
    )
    at com.steadystate.css.parser.SACParser.styleRule(SACParser.java:1083)
    at com.steadystate.css.parser.SACParser.styleSheetRuleList(SACParser.jav
    a:267)
    at com.steadystate.css.parser.SACParser.styleSheet(SACParser.java:157)
    at com.steadystate.css.parser.SACParser.parseStyleSheet(SACParser.java:5
    8)
    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 org.zefer.pd4ml.tools.PD4Browser.¶00000(Unknown Source)
    at org.zefer.pd4ml.tools.PD4Browser$13.run(Unknown Source)
    at org.zefer.pd4ml.tools.PD4Browser$11.run(Unknown Source)
    at java.lang.Thread.run(Unknown 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?

    #28232

    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?

    #28233

    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;

    #28234

    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:

    1) FIELDSET & LEGEND
    2) P (Paragraph)

    These are important HTML to us.

    #28235

    I have added example FIELDSET HTML + STYLES:

    HTML:

    Information Group

    CSS:

    .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:

    HTML:
    Enter your rich text here

    CSS:

    /* 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.

    #28236

    Attached Document.

    #28237

    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;
    }[/language:lhug3mi0]

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

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