Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Whenever you want to apply something to every page, you should use page events, more specifically <a href="http://api.itextpdf.com/itext/com/itextpdf/text/pdf/PdfPageEvent.html#onEndPage%28com.itextpdf.text.pdf.PdfWriter,%20com.itextpdf.text.Document%29" rel="nofollow"><code>PdfPageEvent.onEndPage(),</code></a> to do it. You can find samples for its usage by keyword <a href="http://itextpdf.com/themes/keyword.php?id=220" rel="nofollow">Page events > onEndPage</a> --- these samples are taken from <a href="http://itextpdf.com/book/" rel="nofollow">iText in Action 2nd Edition</a>. The samples mainly add footers and headers while you want to add background graphics.</p> <p>Be aware that you shouldn't add content to the <code>Document</code> instance here but instead directly to the <code>PdfWriter,</code> and as you want the image to be under the page content , not above it, you will need to use <code>PdfWriter.getDirectContentUnder()</code> like in the sample <a href="http://itextpdf.com/examples/iia.php?id=114" rel="nofollow"><code>Stationery</code></a> and not <code>PdfWriter.getDirectContent()</code> like in the other samples.</p> <p><strong>PS:</strong> The analogous samples for .Net can be found <a href="http://kuujinbo.info/iTextInAction2Ed/index.aspx" rel="nofollow">here.</a></p> <p><strong>PPS:</strong> The sample <a href="http://itextpdf.com/examples/iia.php?id=70" rel="nofollow">ImageDirect.java</a> / <a href="http://kuujinbo.info/iTextInAction2Ed/index.aspx?ch=Chapter03&amp;ex=ImageDirect" rel="nofollow">ImageDirect.cs</a> shows how to add an image to some direct content which might be the information missing here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload