csv,pdf, xml supported in freemarker template output - freemarker

Does freemarker template support output in csv, pdf, html and xml.
any other java based template framework supporting all these formats.
Thanks.

It supports all kind of text output, like most other template engines as well. Template engines, with some exceptions, don't care what the generated output means. (For PDF you certainly want to generate in some more human-readable format, and then use another software to render it to PDF.)

Related

How can I refer one YAML file from another?

I have a YAML file, which I want to refer into a different YAML file. Is this possible, if yes, if someone can help me with the syntax or examples? Would be great help
Each YAML document is self-contained and thus cannot refer to any external data or resource. YAML doesn't even know the concept of files; YAML documents are contained in a stream which might be a file, a network socket, anything.
Various YAML users employ various techniques to refer to outside content, like OpenAPI's $ref or Ansible's and Helm's preprocessing with templating engines. However all those features are only supported in their respective environments and are not YAML features.
If you are in control of the code loading the YAML file, you can of course implement your own method. If you are not in control of the code loading the YAML file, all you can do is either depend on whatever features the loading code offers, or manually preprocess your YAML with some templating engine to produce a single merged YAML file which you then hand over to the loading code.

Valid output types for play twirl template

What are the valid types that can be generated by a Twirl template in play framework? I know that I can generate HTML. I would like to generate an svg. Is that possible?
If I have a file named foo.scala.html, then I do get a generated class. foo.scala.svg does not result in a class.
Are the options documented anywhere?
I am currently using PlayFramework 2.5.2, but upgrading should be possible.
What are the valid types that can be generated by a Twirl template in play framework?
https://github.com/playframework/twirl#template-files:
Template files must be named {name}.scala.{ext} where ext can be html, js, xml, or txt.
I would like to generate an svg. Is that possible?
Not out of the box. You can implement a custom format yourself though. See https://www.playframework.com/documentation/2.5.x/ScalaCustomTemplateFormat

How to print entities from entity print module?

I am using Drupal 8 and working on Eform types. I had to generate PDF from eform submissions. I used entity print module for this and am using DOMPDF as PDF Engine. I am able to apply custom css to the pdf but the requirements are still not covered. Now I need to override the template so that I can customize the PDF as per my requirement, I could not achieve this. Few requirements:
I need to insert tabular format.
Custom sequence of entities/fields.
Site Logo
Is there any way to do so?
You could also go to he link to get more details on the output before it is sent to the pdf engine.
/print/pdf/node/86/debug

play framework 1.x to render rich text

I am using Play framework 1.x and in one case, we are saving rich text data (I am currently using using ckeditor-JS on client side but am open to other suggestions e.g. markdown etc). The data gets saved in the DB correctly i.e. with the HTML tags (unless I am misinterpreting how it ought to be saved). I need to be able to render this content as HTML in my view - should I be looking to use the same library for handling the conversion or is there something in play framework (1.x) itself that I could possibly use. Hope I explained the question properly and thanks in advance to any useful suggestions.

PDF Creation from a word template

I have this requirement:
Generate a Word document from template using poi.jar. The generated doc will have dynamic values as well as the formatting needed.
Convert the generated doc as it is to PDF. I don't want to apply any formatting again while generating the PDF.
Is there any open source Java API available to do this?
OpenOffice.org offers an API that can do the job for you.
Please note that this question has been answered many times on StackOverflow (and over the web), see this answer for example.

Resources