PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: java.lang.NullPointerException - Not picking up CSS file
   PostPosted: 06 Oct 2010, 22:03 
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?


  Subject: Re: java.lang.NullPointerException - Not picking up CSS file
   PostPosted: 07 Oct 2010, 15:04 
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?


  Subject: Re: java.lang.NullPointerException - Not picking up CSS file
   PostPosted: 07 Oct 2010, 17:33 
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;


  Subject: Re: java.lang.NullPointerException - Not picking up CSS file
   PostPosted: 07 Oct 2010, 19:31 
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.


  Subject: Re: java.lang.NullPointerException - Not picking up CSS file
   PostPosted: 08 Oct 2010, 11:26 
I have added example FIELDSET HTML + STYLES:

HTML:

<fieldset class="fieldsetGroup vertical" id="group_info">
<legend class="fieldsetGroupLabelBackground" id="group_info_label_container">
<span class="label" id="group_info_label">Information Group</span></legend>
...

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:
<p>Enter your rich text here</p>

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.


  Subject: Re: java.lang.NullPointerException - Not picking up CSS file
   PostPosted: 08 Oct 2010, 11:27 
Attached Document.


Attachments:
PD4ML_Test_Document_Fieldset_and_P.doc [144.5 KiB]
Downloaded 90 times
  Subject: Re: java.lang.NullPointerException - Not picking up CSS file
   PostPosted: 12 Oct 2010, 14:21 
Here you are faced with restrictions of PD4ML.

1. PD4ML offers only a lightweight support of <legend>. 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 <legend> tag), but background colors and borders are going to be ignored.

2. PD4ML allows to apply styles to <p>. But <form> 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.

.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;
}



[Reply]     [ 7 posts ] 

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share