We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDFDocument Header

Thread ID:

Created:

Updated:

Platform:

Replies:

45582 Jun 23,2006 07:24 PM UTC Jun 27,2006 06:04 PM UTC ASP.NET Web Forms (Classic) 4
loading
Tags: PDF
Administrator [Syncfusion]
Asked On June 23, 2006 07:24 PM UTC

Hi, I am trying to use the Header template to add a header to each page of my PDFDocument. I need to be able to adjust the title of the page based on what section the page belongs to but other than that, all my header areas look the same. I found the code to add a header to the whole PDFDocument (pdfDoc.Templates.Header = header;) but when I try to adjust the header text based on a page range, by doing the following: for (int i = intStartPage; i <= intEndPage; i++) pdfDoc.Pages[i-1].Header = header; I get the following error message: "Cannot remove the specified item because it was not found in the specified Collection. " BUT if I do the following: pdfDoc.LastPage.Header = header; I can change the page title within the header area. The problem is, this changes only the last page within the a range of pages I would like to adjust the title for. Please help!

Administrator [Syncfusion]
Replied On June 26, 2006 02:45 PM UTC

Hi Michelle, Sorry for the delay in getting back to you i was able to see the problem with your approach. However here is an alternative to do the same. Sample: Sample Please take a look at the sample let me if it helps you to resolve the problem. Thanks, Ajish.

Administrator [Syncfusion]
Replied On June 26, 2006 07:18 PM UTC

This is not exactly what I was looking to do. This puts the same header on each page of the PDF document. I found this in Syncfusion''s Help area: Different headers and footers: If the document you are working on needs to have different headers and footers on various pages, you can use section breaks to achieve this. IPDFSection section = pdfDoc.AddSection(); section.BreakCode = SectionBreakCode.NewPage; But I do not know what assembly to include to be able to user the IPDFSection. Could you point me in the right direction? Will this let me assign a different header object to each section within the PDF? >Hi Michelle, > >Sorry for the delay in getting back to you i was able to see the problem with your approach. However here is an alternative to do the same. > >Sample: Sample > >Please take a look at the sample let me if it helps you to resolve the problem. > >Thanks, >Ajish. >

Administrator [Syncfusion]
Replied On June 26, 2006 07:30 PM UTC

Please disregard the question about the sections within a PDF document, I found it and it only applies to the PDFLogicDocument, not the PDFDocumnet (FHI - that should be added to the help file for clarification). Can you still provide me an alternate way to adjust the headers within "sections" of a PDFDocument? I need to reserve the top for header information (each page will have the same look, but the title of the page will change with each new "section"). Thanks!! >This is not exactly what I was looking to do. This puts the same header on each page of the PDF document. > >I found this in Syncfusion''s Help area: >Different headers and footers: If the document you are working on needs to have different headers and footers on various pages, you can use section breaks to achieve this. > >IPDFSection section = pdfDoc.AddSection(); >section.BreakCode = SectionBreakCode.NewPage; > >But I do not know what assembly to include to be able to user the IPDFSection. Could you point me in the right direction? > >Will this let me assign a different header object to each section within the PDF? > >>Hi Michelle, >> >>Sorry for the delay in getting back to you i was able to see the problem with your approach. However here is an alternative to do the same. >> >>Sample: Sample >> >>Please take a look at the sample let me if it helps you to resolve the problem. >> >>Thanks, >>Ajish. >>

Ajish [Syncfusion]
Replied On June 27, 2006 06:04 PM UTC

Hi, Yes you are right, there is no concept of sections in Grid model [ PDFDocument]. Grid model deals only with pages in general. You can have different headers in different page with the help of page event handler and AddHeader helper function. Here is a sample for your reference: DifferentHeadersAndFooters.zip This sample contains some set of page with Page title as summary, funding and schedule. Please let me know if have any concerns. Thanks, Ajish.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;