Some paragraphs displaying in the wrong place, some don't display at all

Mike Bowen 1,276 Reputation points Microsoft Employee
2020-12-11T21:27:20.89+00:00

Note, this case originates from the now closed Open Specifications Forum and is continuing here.
https://social.msdn.microsoft.com/Forums/en-US/dbbc486e-f3f0-496e-a34e-ef6596b2e0a2/some-paragraphs-displaying-in-the-wrong-place-some-dont-display-at-all?forum=os_binaryfile

Hi all;

To understand my question, here is our use case. We have a program that takes a DOCX file, that has tags for data in it (think mail merge on steroids) and generates a PDF. Our code generates the PDF, we do not call Word.

If you look at the file ATE-4471_template.docx on page 3 you see:

47436-1625910.png

Then look at the PDF we generate from it, ATE-4471_output.pdf. On page 2 you see:

47525-1625911.png

So two big questions. First, the text "39-IC-F0852 - Issue 3.0" is displayed in Word at the top of the header. But it occurs in the header after the "Australian Certificate of..." content. Why does it get rendered above.

Second, all the text in red at the bottom of the header - that exists in the DOCX file. But Word does not display it. Why?

thanks - dave

Hi Mike;

Yes, happy to do so. Please open header4.xml and search for F00000. That will get you the text that is in red. What does that text not display in Word?

thanks - dave

Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
120 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Bowen 1,276 Reputation points Microsoft Employee
    2020-12-14T22:37:02.953+00:00

    Hi Dave,

    It turns out the text is actually being shown in the document, but it's not visible, because it's outside the range of what is shown in the header. If you search for "ANZ CoC”or “ANZ CoCA” THEN" in Word, Word finds 2 examples, but they can't be seen visually in the document. However, if you click in an instance of header4 then select all/ctrl + a and paste into Notepad. When you search for the missing text like "IF “Mark” = “ANZ CoCA” THEN" you'll be able to see it like below:

    48105-txt-from-word.png

    I don't know enough about doc layout to understand what happens when you have more text in the header than can show, but it appears that's what's happening.

    Let me know if that answers your question.

    Mike

    1 person found this answer helpful.
    0 comments No comments