Free Support Forum - aspose.com

Page Footer disappeared while merge tables

Hi,

We found a problem that Page footer disappeared if the table merged cross the page.(data is too much, e.g.)

Is it by design or do we have some settings option to make header and footer stay in each page?
Hi Guilin,

Thanks for your inquiry. To ensure a timely and accurate response please supply us with the following information, if you cannot supply us with this information we will not be able to investigate your issue and raise a ticket.

What environment are you running on?

  • OS (Windows Version or Linux Version)
  • Architecture (32 / 64 bit)
  • Java version
  • Please supply us with the code from your application that is causing the issue
  • Please supply us with the input document that is causing the issue
  • Please supply us with the output document showing the undesired behavior
  • Please supply us with the expected document showing the desired behavior (You can create this document using Microsoft Word).

As soon as you get these pieces of information to us we'll start our investigation into your issue.

Moreover, I suggest you please read following documentation link for your kind reference.
http://www.aspose.com/docs/display/wordsjava/Controlling+How+Header+and+Footers+Appear


Hi Tahir,

Thanks for your reply, let me describe the detailed problem:
We have a big template which contains header and footer.
After mailmerge, the header and footer only exist in odd page but not even page.
Do we have some control parameters about this?
And it still don’t work even if I set linkToPrevious = true

My env info:
Mac OS/Java 1.6.x 64bit

The application code and template is confidential so I can not give it out here. I will try to make a fake one later.

Hi Guilin,


Thanks for sharing the details. Please use the setOddAndEvenPagesHeaderFooter and setDifferentFirstPageHeaderFooter method of PageSetup class to work with options ‘Different First Page’ and 'Differnt Odd & Even Pages

setDifferentFirstPageHeaderFooter : True if a different header or footer is used on the first page.

setOddAndEvenPagesHeaderFooter : True if the document has different headers and footers for odd-numbered and even-numbered pages.

Please check the following code snippet for your kind reference.

<span style=“font-size:
10.0pt;font-family:“Courier New”;color:#2B91AF;mso-no-proof:yes”>DocumentBuilder<span style=“font-size:10.0pt;font-family:“Courier New”;mso-no-proof:yes”> builder = new DocumentBuilder();<o:p></o:p>

PageSetup ps = builder.getPageSetup();

ps.setDifferentFirstPageHeaderFooter(true);

ps.setOddAndEvenPagesHeaderFooter(true);

builder.moveToHeaderFooter(HeaderFooterType.HEADER_FIRST);

builder.writeln("First page header.");

builder.moveToHeaderFooter(HeaderFooterType.HEADER_EVEN);

builder.writeln("Even pages header.");

builder.moveToHeaderFooter(HeaderFooterType.HEADER_PRIMARY);

builder.writeln("Odd pages header.");

// Move back to the main story of the first section.

builder.moveToSection(0);

builder.writeln("Text page 1.");

builder.insertBreak(BreakType.PAGE_BREAK);

builder.writeln("Text page 2.");

builder.insertBreak(BreakType.PAGE_BREAK);

builder.writeln("Text page 3.");

builder.getDocument().save(MyDir + "PageSetup.DifferentHeaders Out.doc");



It is hard to investigate the issue without template document. Please create a fake template and share it with us along with sample code snippet for investigation purposes.