HTML to PDF / DOCX / RTF Java converter library Forums PD4ML v3 Archived Forums (Read Only) General questions / FAQ how to add css files in jsp which is transformed to pdf ??

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #26911

    Hello ,

    As I m working on applying css styles to pdf generated using pd4ml tool. The problem I m going through is where do i add these lines in my JSP so that external css files are added in my JSP.

    PD4ML pd4ml = new PD4ML();
    pd4ml.addStyle(“url of file containing styles”,true);

    and pd4ml.enableDebugInfo() ain’t working as i don’t know where exactly i should place this code in my JSP file which transform to pdf.

    #29497

    If you use custom tag, you may enable debug info with debug=”true” attribute.

    There is no need to call pd4ml.addStyle() in JSP, as you may add inline

    #29501

    When I link css . this is wat i m getting.

    17:46:18,954 INFO [stdout] (default task-35) I m in summary PDF

    17:46:18,957 INFO [stdout] (default task-35) version: PD4ML 385fx6 Pro (eval)

    17:46:19,141 INFO [stdout] (default task-35)

    17:46:19,142 INFO [stdout] (default task-35)

    17:46:19,142 INFO [stdout] (default task-35)

    17:46:19,142 INFO [stdout] (default task-35)

    17:46:19,142 INFO [stdout] (default task-35)

    17:46:19,142 INFO [stdout] (default task-35)

    17:46:19,142 ERROR [stderr] (default task-35) org.w3c.css.sac.CSSException: Encountered “<" at line 2, column 1. 17:46:19,143 ERROR [stderr] (default task-35) Was expecting one of: 17:46:19,143 ERROR [stderr] (default task-35)

    17:46:19,143 ERROR [stderr] (default task-35)

    17:46:19,143 ERROR [stderr] (default task-35) “.” …

    17:46:19,143 ERROR [stderr] (default task-35) “:” …

    17:46:19,143 ERROR [stderr] (default task-35) “*” …

    17:46:19,144 ERROR [stderr] (default task-35) “[” …

    17:46:19,144 ERROR [stderr] (default task-35) “::” …

    17:46:19,144 ERROR [stderr] (default task-35)

    17:46:19,144 ERROR [stderr] (default task-35) “” …

    17:46:19,144 ERROR [stderr] (default task-35) “@import” …

    17:46:19,144 ERROR [stderr] (default task-35) “@page” …

    17:46:19,144 ERROR [stderr] (default task-35) “@media” …

    17:46:19,144 ERROR [stderr] (default task-35) “@font-face” …

    17:46:19,145 ERROR [stderr] (default task-35)

    17:46:19,145 ERROR [stderr] (default task-35)

    17:46:19,145 ERROR [stderr] (default task-35)

    17:46:19,145 ERROR [stderr] (default task-35) at com.steadystate.css.parser.SACParser.parseStyleSheet(SACParser.java:60)

    17:46:19,146 ERROR [stderr] (default task-35) at org.zefer.html.doc.css.d.Ò00000(Unknown Source)

    17:46:19,146 ERROR [stderr] (default task-35) at org.zefer.html.doc.css.c.super(Unknown Source)

    17:46:19,146 ERROR [stderr] (default task-35) at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)

    17:46:19,146 ERROR [stderr] (default task-35) at org.zefer.pd4ml.PD4ML.super(Unknown Source)

    17:46:19,146 ERROR [stderr] (default task-35) at org.zefer.pd4ml.PD4ML.render(Unknown Source)

    17:46:19,146 ERROR [stderr] (default task-35) at org.zefer.pd4ml.PD4ML.render(Unknown Source)

    17:46:19,147 ERROR [stderr] (default task-35) at org.zefer.pd4ml.PD4ML.render(Unknown Source)

    17:46:19,147 ERROR [stderr] (default task-35) at org.zefer.pd4ml.taglib.PD4MLTransformerTag.render(Unknown Source)

    17:46:19,147 ERROR [stderr] (default task-35) at org.zefer.pd4ml.taglib.PD4MLTransformerTag.doEndTag(Unknown Source)

    17:46:19,147 ERROR [stderr] (default task-35) at org.apache.jsp.WEB_002dINF.Jsp.itembank.SummaryPDF_jsp._jspService(SummaryPDF_jsp.java:503)

    17:46:19,147 ERROR [stderr] (default task-35) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)

    17:46:19,148 ERROR [stderr] (default task-35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

    17:46:19,148 ERROR [stderr] (default task-35) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365)

    17:46:19,148 ERROR [stderr] (default task-35) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:321)

    17:46:19,148 ERROR [stderr] (default task-35) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:254)

    17:46:19,148 ERROR [stderr] (default task-35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

    17:46:19,149 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:87)

    17:46:19,149 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)

    17:46:19,149 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)

    17:46:19,149 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)

    17:46:19,149 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)

    17:46:19,150 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)

    17:46:19,150 ERROR [stderr] (default task-35) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)

    17:46:19,150 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)

    17:46:19,150 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)

    17:46:19,150 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:57)

    17:46:19,151 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

    17:46:19,151 ERROR [stderr] (default task-35) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

    17:46:19,151 ERROR [stderr] (default task-35) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

    17:46:19,151 ERROR [stderr] (default task-35) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

    17:46:19,151 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:207)

    17:46:19,152 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:150)

    17:46:19,152 ERROR [stderr] (default task-35) at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:157)

    17:46:19,152 ERROR [stderr] (default task-35) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)

    17:46:19,152 ERROR [stderr] (default task-35) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:263)

    17:46:19,152 ERROR [stderr] (default task-35) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)

    17:46:19,153 ERROR [stderr] (default task-35) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)

    17:46:19,153 ERROR [stderr] (default task-35) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)

    17:46:19,153 ERROR [stderr] (default task-35) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)

    17:46:19,153 ERROR [stderr] (default task-35) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)

    17:46:19,154 ERROR [stderr] (default task-35) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)

    17:46:19,154 ERROR [stderr] (default task-35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

    17:46:19,154 ERROR [stderr] (default task-35) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)

    17:46:19,154 ERROR [stderr] (default task-35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

    17:46:19,154 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:87)

    17:46:19,155 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)

    17:46:19,155 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)

    17:46:19,155 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)

    17:46:19,155 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)

    17:46:19,155 ERROR [stderr] (default task-35) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)

    17:46:19,156 ERROR [stderr] (default task-35) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)

    17:46:19,156 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)

    17:46:19,156 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)

    17:46:19,156 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:59)

    17:46:19,156 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

    17:46:19,157 ERROR [stderr] (default task-35) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:81)

    17:46:19,157 ERROR [stderr] (default task-35) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

    17:46:19,157 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)

    17:46:19,157 ERROR [stderr] (default task-35) at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)

    17:46:19,157 ERROR [stderr] (default task-35) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)

    17:46:19,158 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:65)

    17:46:19,158 ERROR [stderr] (default task-35) at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:70)

    17:46:19,158 ERROR [stderr] (default task-35) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

    17:46:19,158 ERROR [stderr] (default task-35) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

    17:46:19,158 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:218)

    17:46:19,159 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:205)

    17:46:19,159 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:69)

    17:46:19,159 ERROR [stderr] (default task-35) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:134)

    17:46:19,159 ERROR [stderr] (default task-35) at io.undertow.server.HttpHandlers.executeRootHandler(HttpHandlers.java:36)

    17:46:19,160 ERROR [stderr] (default task-35) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:619)

    17:46:19,160 ERROR [stderr] (default task-35) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

    17:46:19,160 ERROR [stderr] (default task-35) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

    17:46:19,160 ERROR [stderr] (default task-35) at java.lang.Thread.run(Thread.java:744)

    17:46:19,207 INFO [stdout] (default task-35) done in 251ms.

    what should I do..???
    and Thanks for your quick response ..:)

    #29502

    Obviously you have HTML-like comments in the CSS file. It is invalid from CSS file format perspective. Correct comment syntax is /* */

    Try to remove constructs like .

    #29499

    As I have gone through all 3 css files that is linked to the jsp. I could not notice any comments starting from . But still I m getting that exception.

    Can yu tell me the where i m lacking..

    #29500

    You should not enclose CSS links to

    [/language:3a7shx90]

    Correct (must be placed to ):
    [language=xml:3a7shx90] [/language:3a7shx90]

    #29498

    Now I am able to load the css files in my JSP , I could see it in console. I could see all 3 css linked to jsp and der code in console window. But still i m getting this error.

    org.w3c.css.sac.CSSException: Encountered “}” at line 564, column 1.

    I dont know which line and column its referring to.

    Thanks,
    Abida

    #29503

    I have included pd4ml_demo.jar , pd4ml_tl_demo.jar , ss_css2.jar and w3c.jar files in lib of web-inf folder and have included the respective tlds. Do I need to add any more jars..??

    Can you please let me know the solution to handle this exception .

    org.w3c.css.sac.CSSException & at com.steadystate.css.parser.SACParser.parseStyleSheet..

    #29504

    Just released v390 addresses the issue. Do not forget to copy an updated ss_css2.jar from the distribution package to your application resources.

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

The forum ‘General questions / FAQ’ is closed to new topics and replies.