Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken DifferentOddAndEvenPages property #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fixed broken DifferentOddAndEvenPages property #149

wants to merge 2 commits into from

Conversation

GrabzIt
Copy link
Contributor

@GrabzIt GrabzIt commented Sep 19, 2017

No description provided.

@XceedBoucherS
Copy link
Collaborator

Hi,
Can you provide a description of the problem please ? It could already be fixed in a latest version.
Thanks.

@GrabzIt
Copy link
Contributor Author

GrabzIt commented Oct 10, 2017

The first issue is that the DifferentOddAndEvenPages property wasn't allowing diffrerent odd and even pages. This was because the evenAndOddHeaders XML element was missing val="1".

The second issue is that RTL text wasn't working this was because rtl was being applied to all child text elements.

@XceedBoucherS
Copy link
Collaborator

Hi,

Can you send a sample or modify this one please ?
When I use the following sample, I've got 2 pages with different headers.

var document = DocX.Create( @"abc.docx" );

  document.AddHeaders();
  document.AddFooters();

  document.DifferentOddAndEvenPages = true;

  // Define Odd pages header's
  var oddHeader = document.Headers.Odd;
  oddHeader.InsertParagraph().AppendLine( "This is an odd Header" );

  // Define Odd pages footer's
  var oddFooter = document.Footers.Odd;
  oddFooter.InsertParagraph().AppendLine( "This is an odd Footer" );

  // Define Even pages header's
  var evenHeader = document.Headers.Even;
  evenHeader.InsertParagraph().AppendLine( "This is an even Header" );

  // Define Even pages footer's
  var evenFooter = document.Footers.Even;
  evenFooter.InsertParagraph().AppendLine( "This is an even Footer" );

  document.InsertParagraph( "FIRST" );
  document.InsertSectionPageBreak();
  document.InsertParagraph( "Second" );

  document.Save();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants