Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

lastRenderedPageBreak missing when starting page/col with empty paragraphs

$
0
0

Is this the right forum for this topic? - I posted in the Office Open XML File Format Implementation, but was told that this forum was a better fit.

Tested in MSWord 2010.

For all of the following cases a 2 page doc is created by hitting enter until the cursor is moved to the next page. The first body element on page 2 is a...

body elementlastRenderedPageBreak exists?
blank paragraphno
paragraph with spaceyes
paragraph with textyes
a blank in-line textboxyes
an in-line pictureyes
a table with blank first column paragraphno
a table with first column paragraph having a spaceyes

The result is the same for starting columns with those elements too.

It seems that when the first paragraph is missing a run, no lastRenderedPageBreak exists. Is there a reason why it was implemented this way? Why not create an empty run with just the lastRenderedPageBreak element inside?

The goal is to be able to read the word/document.xml and be able to determine where the page breaks are. There are work arounds for determining page breaks with the lastRenderedPageBreak element not present:

  1. If the previous paragraph used an explicit page/col break.
  2. If the previous paragraph ended a section (except continuous sections)

I can detect missing lastRenderedPageBreaks that cannot be derived from the 2 work arounds by looking at the docProps/app.xml Pages value. If it says 3 pages it should contain 2 lastRenderedPageBreaks (assuming you are using single column pages). If it doesn't contain 2 lastRenderedPageBreaks it most likely matched one of the above scenarios, but I won't have any idea on where the lastRenderedPageBreak should have been placed...

I understand that if I were modifying the xml directly, the lastRenderedPageBreak would become unreliable...but I'm just reading what MSWord is producing. Are there any plans to make the lastRenderedPageBreak element more consistent? Why are blank paragraph such a pain to deal with? Is there any solution to finding page breaks solely looking at the word/document.xml?

Thanks!

Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>