FMK2017 - Scriptprogrammierung und Fehlerbehandlung in FileMaker by Heike Lan...
Alfresco - Generate documents dynamically from templates
1. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
1
Generate dynamically documents from templates and
print integration
Alfresco Tech Talk Live #114 – David Antón Lou
2. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
2
• Pharma standarized documents
q Must accomplish GMP(Good Manufacturing Practises)
q Custom .docx template for each type
q Generate .pdf files
q Automatic fields filling
q Watermarks
q Network printing
What is the business case?
Introduction
3. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
3
Templates are fine...
But not quite
Document
Templates With templates we can:
✓ Easy way to create documents
✓ Save time writting common parts
✓ Follow the GMP standards
But we have some problems if:
✗ Wrong template
✗ Want to update metadata
4. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
4
First, remove the parts that
might change
Document
Templates
Docx4j
• Remove header and footer
• Remove cover page body
• Remove history page body
5. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
5
After that, generate custom
parts from freemarker
templates
Document
Templates
6. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
6
Finally, construct the pdf
joining all parts
Document
Templates
7. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
7
And the final result...
Document
Templates
8. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
8
As a summary
Document
Templates
With this approach we can:
✓ Modify documents dynamically
✓ Change templates on runtime
✓ Without editing manually documents
Docx4j
9. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
9
• CUPS(Common Unix Printing System)
• Integration using Cups4j
q For get all the printers in the local network
Going back to the paper.
Unfortunately, in some
business cases it‘s necessary
Network
Printing
10. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
10
• Integration using Cups4j
q For printing documents in concrete printer
Going back to the paper.
Unfortunately, in some
business cases it‘s necessary
Network
Printing
11. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
11
Demo
12. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
12
About the
team
“Es de bien nacido, el ser
agradecido„
Eduardo Luján
Technology and Infraestructure
Beatriz Estévez
Software Engineer
@mimacom
https://www.linkedin.com/company/mimacom
13. Copyright: mimacom ag, 2018. Alle Rechte vorbehalten, auch bzgl. jeder Verwertung, Reproduktion und Weitergabe
Alfresco Tech Talk, 14th March 2018
13
About me
David Antón Lou
Software Engineer
mimacom Ibérica
Av. Portal de l’Ángel 38, 3er 4ª
08002 Barcelona
T: +34 93 024 96 92
E: david.anton@mimacom.com
@davidantonlou
https://www.linkedin.com/in/davidantonlou/