Quote of the Day

more Quotes

Categories

Buy me a coffee

Tag Archives for " template method "

Template method example

Published October 31, 2021 in Design Patterns - 0 Comments

In a project I work on, I need to programmatically fill out some PDF forms. The forms are very similar in terms of structure, content, and fields’ names. Using iTextSharp library, I can go through the fields in the PDF and set the values. The logic for filling out a PDF form can be generic, as I just need to know what are the fields’ names and the corresponding values of the PDF. I come up with a generic model and common logic for filing out the form, as demonstrated in the below snippets.

Continue reading