Supercharge Your Documents: Unveiling the XHTML Magic in Acorel Document Service

John Lee, 21 June 2023

Acorel Document Service (ADS) is a tool that allows businesses to create data-driven documents by integrating external data sources via API. It streamlines document creation, enhances productivity, and produces accurate documents and has robust security features.

ADS Template Options

When using ADS, you have two options for creating templates: Word documents (docx) and XHTML pages (xhtml). The majority of the documents are Word documents due to their widespread use and perceived ease of use for beginners.

However, if you require complex scripting or advanced features, especially when generating documents with PDF output, XHTML is the preferred choice. Creating templates using XHTML requires a basic understanding of HTML and CSS, which are languages used for building web pages.

Why choose XHTML?

Firstly, it offers a reliable and structured approach to creating web-based templates. The standardized nature of XHTML ensures that your documents are consistent and predictable. Secondly, if you need to incorporate advanced features or interactivity in your templates, such as form elements or dynamic content, XHTML provides a suitable foundation.

Another advantage of XHTML is its improved readability for scripting purposes. With well-structured markup and clear separation of content and presentation through CSS, it becomes easier to write and maintain scripts within the template.

How to get started?

To get started with creating an XHTML template for ADS, you’ll follow a process similar to building a website. You’ll define the document type, set up the HTML structure, apply CSS styles, and place your template content within the appropriate tags.

By leveraging the power of XHTML templates in ADS, you can create visually appealing, interactive, and accessible documents with advanced features and reliable output.

Example:

code podcpmycbb

The “@page” at-rule in CSS is used to modify the properties of printed pages. It allows you to target and adjust dimensions, orientation, and margins. By using pseudo-classes, you can apply modifications to all or specific pages. One commonly used pseudo-selector is “@bottom-center”, which enables you to modify aspects of the page footer for printed pages. This allows you to add information like page numbers or copyright notices to enhance the printed output. More info CSS at-rule

msedge yak5p2vtuf

Scripting with Freemarker

There is a difference when incorporating oData into an HTML page. Using XHTML tags to integrate data into the page is often considered easier and provides a cleaner visual presentation. In Word, the approach involves using merge fields to incorporate data into the document. Comparatively, in XHTML, you utilise HTML-like tags to structure and display the data, resulting in a more streamlined and visually appealing representation.

code kpvkaqdtbr

In the provided sample, you can notice the presence of Freemarker tags, specifically <#if> and <#list>, within the XHTML page.
These tags serve a similar purpose to merge fields in Word documents. When displaying content, you can use the dollar brackets ${} in XHTML. When scripting in XHTML, the code tends to be more readable compared to working in Word. In Word, you may find yourself stacking merge fields in cramped spaces, making it difficult to understand your code at times. However, in XHTML, the code is structured and formatted in a way that improves readability.

Conclusion

In conclusion, mastering the basics of XHTML templates and working with Freemarker tags will empower you to create visually appealing and dynamic documents with ease. I hope this blog has provided you with valuable insights and helped you on your journey of Acorel Document creation.

For more info about ADS, you can find it here.  A previous blog with tips and tricks you can find here.

Receive our weekly blog by email?
Subscribe here:

More blogs