Turn "on the fly" pages of a word document to a paragraph

80 Views Asked by At

I have a set of docx files autogenerated from a pdf set

I further want to turn these documents to a specific json structures for future use

And I need indexed paragraphs and pages so that they match, meaning

index object
1 pg 1
2 paragaraph 1
3 paragraph 2
4 pg 2
5 paragraph 3

I use free Xceed.DocX lib and it allows to get docx paragraph as an ordered list and so it does deliver pages (they are treated as a paragraph in most cases).

Sometimes however it does not. Now I have the case when page numbers are calculated "on the fly" when opening in word and I'm searching for an option to somehow auto add an extra paragraph (it can be tiny, mb 1px font size) on each page which will contain just current page number.

I think this should be possible with Word automation, please let me know if you have any idea

1

There are 1 best solutions below

0
Anton Maiorov On

I got PDF as a starting point and page numbers "hardcoded" in it. Turning them to DOCX via online tools bring these numbers to be paragraphs (in most cases). Anyway found a tool that does insert page paragraphs in my case.

The tool is: https://pdf2docx.com/