XHTML output and PDF

Posted by Tambet Matiisen on
URL: https://discuss.orbeon.com/XHTML-output-and-PDF-tp3026751.html

Hi everyone!

I've been working on generating PDF from Orbeon forms output. Here is
what I did:
1. Set oxf.epilogue.output-xhtml=true in properties-local.xml, so that
output of Orbeon can be easily fed into XHTMLRenderer
(https://xhtmlrenderer.dev.java.net/).
2. Preprocessed the form so that:
   a) all xforms:binds have attribute readonly="true()",
   b) the xforms:model has attribute xxforms:readonly-appearance="static",
   c) the xforms:model has attribute xxforms:noscript="true" (Orbeon PE
feature).
3. The converter itself is implemented as servlet filter and is engaged
only when there is special parameter (pdf=true) in URL.

I'm happy with the result, but I noticed one thing in the process: even
when oxf.epilogue.output-xhtml=true, the output is still HTML in IE and
it will give error when generating PDF. I tracked the problem down into
/config/epilogue-servlet.xsl in orbeon-resources-private.jar. There is a
check, that XHTML output is produced only, when accept header sent by
browser contains application/xhtml+xml. But IE sends accept header as
*/*, which should be acceptable also. My question is - why is this check
there and can't it be just removed? I want to use vanilla Orbeon with no
custom patches.

I did a little research before sending this e-mail and indeed when
accept header is */*, then output should be text/html.
http://www.w3.org/TR/xhtml-media-types/#media-types

I would rather see, that when oxf.epilogue.output-xhtml=true and accept
header is text/html or */*, then output is still XHTML, but formatted
according to HTML compatibility guidelines (isn't it already?):
http://www.w3.org/TR/xhtml1/#guidelines

Another question - I had to switch to Orbeon PE to generate PDF-s,
because otherwise xxforms:noscript mode was not available. But I
noticed, that read-only forms and PDF generation are working in Orbeon
Form Runner even in CE version. AFAIK you are using the same
XHTMLRenderer. We probably need PE anyway because of other features, but
I'm just curious - could it be possible to make our PDF generation
solution work also with Orbeon CE?

Regards,
  Tambet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws