There was a problem working with Aspose.Words for Java (DOCX, DOC documents).
We need to measure the distance from the text (table, image, element) to the footer (see Fig. “Distance between text (table, figure) and header (footer).png”):
- The distance from the upper border of the text to the lower border of the header (there is always a table with visible borders in the header)
- The distance from the lower border of the text to the upper border of the footer (there is always a table with visible borders in the footer)
Because we didn’t find how to measure this distance using the standard Aspose.Words for Java functional, we did the following:
- Convert a DOCX or DOC file to PDF
- Measure the distance pixel by pixel in the resulting file
But with such an implementation, problems arose:
- For example, the file “Example.docx” was taken.
- The file “Example.doc” (from point 1) was converted to PDF. The conversion result (Example_1.pdf) is the same as the source file.
- The file “Example.doc” (from clause 1) was re-converted to PDF. The conversion result (Example_2.pdf) does not match the source file: on pages 8-11, the header and footer are missing.
- Tell me, please, is there a way to measure the distance from the text (table, image, element) to the header and footer using Aspose.Words for Java tools? Maybe there is a way to access the MS WORD Ruler tool?
- What could be the problem with the disappearance of the footers when converting DOC / DOCX to PDF and how to solve it?
All files are attached in the archive Example_document.zip (518.9 KB).