PDA

View Full Version : Footer on firstpage only


ryan.boud
April 4, 2007, 10:03:10
Hi

We are evaluating the server control for use with our Intranet application. We can get the control to generate PDF files without a problem, however we only want the footer on the first page.

The template is set up in the template designer and then uploaded to our database. The template is a single page document that can become a two page document when the textfields and images are inserted.

Could some post some VB.net code that shows us how we can do this.

Thanks

Björn Meyer
April 4, 2007, 10:19:04
Hello Ryan

TX Text Control offers two different headers and footers: A first page header and the header for the following pages.

To add a first page header, the following code can be used:

ServerTextControl1.HeadersAndFooters.Add(HeaderFoo terType.FirstPageHeader)

In this case, a header is inserted only on the first page of the document.

ryan.boud
April 4, 2007, 16:47:27
The template we have created in TX Template Designer has the footer in there already.

In the code I have put:

TX.HeadersAndFooters.Add(TXTextControl.HeaderFoote rType.FirstPageFooter)
TX.HeadersAndFooters.GetItem(TXTextControl.HeaderF ooterType.Footer).Activate()

However this removes the footer from the first page but leaves it on the 2nd.

Is there a way we can get it leave it on the first page, but remove it from all subsequent?

Gunnar Giffey
April 5, 2007, 17:29:31
If you add a FirstPageFooter, it will replace the Footer on the first page; the Footer will be on all pages starting with page 2.