2 Replies Latest reply on Jun 24, 2008 1:48 PM by SIBUT Nicolas

    Insert the page number of an anchor with itext

    SIBUT Nicolas Newbie

      Hello all.


      I am making the genration of a PDF document using a view xhtml iText.


      I have make a page with the list of my chapter and I have add on anchor to can see a chapter faster.
      I would like to know the page number of each chapter.



      <ui:repeat value="#{elementDocumentService.elements}" var="_elem">
          <s:span rendered="#{_elem.niveau==0}">
           <p:font size="12">
               <p:paragraph>
                <p:anchor reference="##{_elem.id}">
                     <p:text value="#{_elem.chapitre} #{_elem.titre}" />
                </p:anchor>
                </p:paragraph>
           </p:font>
          </s:span>
      </ui:repeat>
      
      <p:newPage/>
      <ui:repeat value="#{elementDocumentService.elements}" var="_elem">
           <s:span rendered="#{_elem.niveau==0}">
            <p:font size="16" style="bold,underline">
                <p:paragraph spacingAfter="20">
                 <p:anchor name="#{_elem.id}">
                         <p:text value="#{_elem.chapitre} #{_elem.titre}" />
                 </p:anchor>
                 </p:paragraph>
            </p:font>
           </s:span>
      </ui:repeat>