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

Suppressing the outer-body page #117

Closed
gkholman opened this issue Feb 26, 2023 · 6 comments
Closed

Suppressing the outer-body page #117

gkholman opened this issue Feb 26, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@gkholman
Copy link

gkholman commented Feb 26, 2023

I am creating two pages in page-number-format-20230226.zip.

There is one page in each of two sections:

<?xml version="1.0" encoding="UTF-8"?>
<wp:document xmlns:wp="urn:ns:wordinator:simplewpml">
  <wp:body>
    <wp:section type="nextPage">
      <wp:page-sequence-properties>
...
      </wp:page-sequence-properties>
      <wp:body>
        <wp:p><wp:run>This is the first page numbered in Roman lower-case</wp:run></wp:p>
      </wp:body>
    </wp:section>
    <wp:section type="nextPage">
      <wp:page-sequence-properties>
...
      </wp:page-sequence-properties>
      <wp:body>
        <wp:p><wp:run>This is the first page numbered in decimal</wp:run></wp:p>
      </wp:body>
    </wp:section>
  </wp:body>
</wp:document>

My end result is three pages long. I'm assuming the page is from the "outer" body as opposed to the section bodies.

Is there a way to suppress the outer-body page? All of my pages are in sections.

@gkholman
Copy link
Author

gkholman commented Feb 26, 2023

This is a duplicate of: #68

Though I am confused about the reference to the "last paragraph" in the guidance given.

@gkholman gkholman reopened this Feb 26, 2023
@gkholman
Copy link
Author

gkholman commented Feb 26, 2023

Sorry, I'm re-opening this because I'm not getting anywhere. This is my latest attempt, where I have only two pages, but both paragraphs are on the first page numbered in decimal, and the second page is blank and numbered in Roman.

page-count-20230226.zip

<?xml version="1.0" encoding="UTF-8"?>
<wp:document xmlns:wp="urn:ns:wordinator:simplewpml">
  <wp:page-sequence-properties>
    <wp:page-number-properties start="1" format="lowerRoman"/>
    <wp:headers-and-footers>
      <wp:header>
        <wp:p style="Normal">
          <wp:page-number-ref/>
        </wp:p>
      </wp:header>
    </wp:headers-and-footers>
    <wp:page-size orient="portrait" width="210mm" height="297mm"/>
  </wp:page-sequence-properties>
  <wp:body>
    <wp:p>
      <wp:run>This is the first page numbered in Roman lower-case</wp:run>
    </wp:p>
    <wp:section type="nextPage">
      <wp:page-sequence-properties>
        <wp:page-number-properties start="1" format="decimal"/>
        <wp:headers-and-footers>
          <wp:header>
            <wp:p style="Normal">
              <wp:page-number-ref/>
            </wp:p>
          </wp:header>
        </wp:headers-and-footers>
        <wp:page-size orient="portrait" width="210mm" height="297mm"/>
      </wp:page-sequence-properties>
      <wp:body>
        <wp:p>
          <wp:run>This is the first page numbered in decimal</wp:run>
        </wp:p>
      </wp:body>
    </wp:section>
  </wp:body>
</wp:document>

The "outer" body has only one paragraph before I start a new "next page" section, yet the second paragraph is on the same page.

What am I missing?

@larsga larsga self-assigned this Mar 1, 2023
@larsga larsga added the bug Something isn't working label Mar 1, 2023
@larsga
Copy link
Collaborator

larsga commented Mar 1, 2023

When Eliot on #68 wrote

The solution is to put the section definition for the last section directly within the body, not within the last paragraph of the section.

he was referring to how to structure the OOXML output.

I just took the output that Wordinator produced and moved the <w:pPr> element from within the last paragraph to being directly within the body, and that solves the problem.

So the trick is to

  1. Figure out how to detect this situation,
  2. Somehow move the properties.

@ekimbernow
Copy link
Collaborator

I've incorporated the updates and test cases from Lars' #118 pull request.

@larsga
Copy link
Collaborator

larsga commented Aug 5, 2024

Great! Thank you. 👍

@larsga
Copy link
Collaborator

larsga commented Aug 5, 2024

Closing as done.

@larsga larsga closed this as completed Aug 5, 2024
drmacro pushed a commit that referenced this issue Aug 5, 2024
Signed-off-by: eliot.kimber <eliot.kimber@servicenow.com>
drmacro pushed a commit that referenced this issue Aug 5, 2024
Signed-off-by: eliot.kimber <eliot.kimber@servicenow.com>
drmacro pushed a commit that referenced this issue Aug 5, 2024
* Fixes #133, #105: Set compatibity mode setting to turn off compatibility mode.

Signed-off-by: eliot.kimber <eliot.kimber@servicenow.com>

* Fixes #109: Incorporate fix from Lars Marius to ensure table cell ends with <p>

Signed-off-by: eliot.kimber <eliot.kimber@servicenow.com>

* WIP: Added multi-section test cases from Lars Marius

Signed-off-by: eliot.kimber <eliot.kimber@servicenow.com>

* Fixes #117: Last section handling from Lars Marius

Signed-off-by: eliot.kimber <eliot.kimber@servicenow.com>

---------

Signed-off-by: eliot.kimber <eliot.kimber@servicenow.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants