Text overlap


original file:
FV.docx (111.2 KB)

code snippet:

com.aspose.words.Document document = new com.aspose.words.Document(inputStream);
FontSettings fontSettings = FontSettings.getDefaultInstance();
com.aspose.words.FolderFontSource folderFontSource = new com.aspose.words.FolderFontSource(getFontDirectory(), true);
fontSettings.setFontsSources(new FontSourceBase[] { new SystemFontSource(), folderFontSource });
document.setFontSettings(fontSettings);
//            document.updateTableLayout();
if (!StringUtils.isEmpty(runningHead))
{
    HeaderFooter primaryHeader = document.getFirstSection().getHeadersFooters().getByHeaderFooterType(HeaderFooterType.HEADER_PRIMARY);
    if (primaryHeader != null)
    {
        String primaryHeaderText = primaryHeader.getText();
        if (!StringUtils.isEmpty(primaryHeaderText) && primaryHeaderText.toLowerCase().contains(runningHead.toLowerCase()))
            primaryHeader.remove();
    }
}
//justify the paragaraoh alignment
Iterable<Paragraph> paragraphs = document.getChildNodes(NodeType.PARAGRAPH, true);
for (Paragraph p : paragraphs)
{
    if (p.getParagraphFormat().getAlignment() == ParagraphAlignment.DISTRIBUTED)
        p.getParagraphFormat().setAlignment(ParagraphAlignment.JUSTIFY);
}
// as per https://forum.aspose.com/t/blank-pages-are-added-in-file/270804?u=tandfsp to avoid new page added by section break
for (Section s : document.getSections())
{
    int start = s.getPageSetup().getSectionStart();
    if (start == SectionStart.EVEN_PAGE || start == SectionStart.ODD_PAGE)
        s.getPageSetup().setSectionStart(SectionStart.NEW_PAGE);
}
if (removeWaterMark)
{
    Watermark watermark = document.getWatermark();
    if (watermark.getType() == WatermarkType.TEXT)
    {
        watermark.remove();
    }
}
if (removeLineNumbers)
{
    PageSetup pageSetup = document.getFirstSection().getPageSetup();
    pageSetup.setLineNumberCountBy(0);
}

com.aspose.words.PdfSaveOptions pdfSaveOptions = new com.aspose.words.PdfSaveOptions();
pdfSaveOptions.setUpdateFields(false);
document.save(directoryPath + PATH_SEPARATOR + outputFileName, pdfSaveOptions);
LOGGER.info(MessageConstants.CONVERTED_WORD_TO_PDF);

aspose version:

<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-total</artifactId>
	<version>23.8</version>
	<type>pom</type>
</dependency>

@TandFSP It looks like you have uploaded a wrong file. The file is the same as in your another thread and does not correspond the provided screenshot of the problem. Could you please check and upload the problematic document here for testing?

hi @alexey.noskov ,

please check this one
Paper.docx (155.8 KB)

@TandFSP The document still does not correspond the provided screenshots and there is no content overlapping. Bu there are two problems with incorrect content layout.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26091,WORDSNET-26092

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.