I am converting a heavy implementation of iText5 to iText7 in vb.net. What hair I have not lost is now gray, thanks to the complete API rewrite.
So in many cases, the OLD iTextSharp code will do something like this:
- create a PdfTemplate object A
- Do stuff to it (rotate it, draw on it, etc)
- create another PdfTemplate object B
- Add PdfTemplate object A to PdfTemplate object B using AddTemplate
- Do other stuff to PdfTemplate B (add a paragraph or something)
- Create a new PdfTemplate object C
- Add Pdftemplate object B (which contains PdfTemplate object A) to PdfTemplate object C using AddTemplate
... and so on.
Now in iText7 I can create a PdfCanvas object that can be drawn on using many of the same drawing functions as iTextSharp, etc. But a PdfCanvas cannot be added to another PdfCanvas in the same manner as with iTextSharp.
I looked at the tutorials but the solution didn't seem apparent. I know it can be done but I'm not sure how to accomplish the same.
I've tried to use Xobjects but that is somewhat limiting; can I convert a PdfCanvas to a PdfFormXObject?