1

I'm using pd4ml to render a URL produced by the Orbeon XForms engine and convert it to PDF.

pd4ml.render( urlstring, fileOutputStram);

The HTML produced by Orbeon from my XForms shows OK in the browser.

But when trying to render the XForms with pd4ml, the PDF show a warning message at the top of the page saying Your browser does not appear to support JavaScript. You may want to try one of the following… because PD4ML not support javascript.

Is there a way to disable the warning message?

avernet
  • 30,895
  • 44
  • 126
  • 163
panox
  • 507
  • 4
  • 13

2 Answers2

1

If you're creating your form with Form Builder, then Form Runner will be able to generate a PDF automatically for you. For this, Form Runner uses Flying Saucer for this, which looks similar to pd4ml.

If you're authoring XForms "by hand", and want to use pd4ml, then you need to do some post-processing of the HTML before you feed it to pd4ml. You can see what Form Runner does in print-pdf-notemplate.xpl; in particular, look for the XSLT stylesheet embedded in that pipeline, and you'll most likely want to do something similar for pd4ml.

avernet
  • 30,895
  • 44
  • 126
  • 163
  • Hi thanks! But I'm not sure it will work for me. The thing is that I have two servers with orbeon and on one server I get the message on the xform "Your browser does not appear to support JavaScript. You may want to try one of the following:" and on the other it doesn't. So my guess is that it is something configurable on orbeon. I need the javascript feature enabled when I request the xform using a web browser. So disable it from the property.xml is not an option. Any suggestion will be appreciated. – panox Jun 22 '12 at 20:55
  • I am not suggesting your disable the JavaScript feature in Orbeon Forms; just that after you make the request to get the page, you transform the page to remove the part of the HTML that will be shown by pd4ml, which doesn't support JavaScript, as done in `print-pdf-notemplate.xpl` (see link above). If you can do this in XSLT, it is really quite simple, and you can reuse the same XSLT code that Orbeon Forms already uses before it feeds the HTML to Flying Saucer. – avernet Jun 26 '12 at 01:20
0

Well I figured it out that the pageflow.xml of all my forms makes reference to the property epilogue url="oxf:/config/epilogue.xpl

Then I enter to the config/property.xml and see that it was linked to /config/theme-plain.xsl

And I add a stylesheet there on theme-plain.xsl

(see the theme-examples.xsl to get an idea on how to)

xhtml:link rel="stylesheet" href="/mystyle.css" type="text/css" media="all"/>

where my style contains this:


    .xforms-noscript-panel {
        border: 4px solid #FF6600;
        margin: 1em;
        padding: 0.5em;
        width: auto;
        display: none !important; 
    }

Then pd4ml will print the html with the warning message hide.

panox
  • 507
  • 4
  • 13