Cannot draw elements on already flushed pages
问题 I wanted to generate the pdf with page numbers and also having table of content which has page numbers in it. I am up to generating PDF but cannot add page numbers to it. ol.anchorLink a::after { content: leader('.') target-counter(attr(href), page); } @page { @bottom-right { padding-right:20px; content: "Page " counter(page); } } this piece of cs is not woking in the dependency i am using which is itextpdf . so I have made changes in the java file @Override public DataHandler getPDFVersion