I use iText to create a PDF document that consists of several copies of almost the same information.
For example: invoice. One copy is provided to the client, another is served, and a third is given to the accountant for accounting.
All copies should be exactly the same, except for a small piece of text that indicates who the copy is (Customer, Accounting, File, ...).
There are two possible scenarios (I don't know if the solution is the same for both of them):
a) Each copy is on the page .
b) All copies are on the page of the same page (the paper will have cutting holes for copying).
A wrapper class or helper class will be created that uses iText to create the PDF file so that it can do something like var pdf = HelperClass.CreateDocument(DocuemntInfo info); . The problem with multiple copies will be solved inside this shell / helper.
What does iText do to accomplish this? Do I need to write each element in a document several times in different positions / pages? Or does iText provide a way to write one copy to a document and then copy it to another position / page?
Note. This is a .Net project, but I marked the question with both java and C #, because this question is about how to use iText correctly, the answer will help both developers and developers.
source share