iText : How do I insert background image in the same document to be flushed to response

前端 未结 3 1522
野趣味
野趣味 2021-01-12 21:19

I am creating a PDF and writing the stream in response. Before writing in the stream, I want to add a background image as watermark in all the pages so that PDF document flu

3条回答
  •  暖寄归人
    2021-01-12 21:49

    You can choose between two options:

    1. Use the background image in a page event (to the 'under' content in the onEndPage() method)/
    2. Create the first PDF in memory, then add the background image in a second pass using the code you posted.

    I prefer option 1.

提交回复
热议问题