Hi,
We use Aspose.Total for Java and have the follow issue:
1. Transform MS Word document to Word document as add new footer to the document:
- one empty page is added in the Word document.
Attach files for reproducing the problem and transformed Word which is broken.
Thanks
- OS (Windows Version or Linux Version)
- Architecture (32 / 64 bit)
- Please supply us with the code that you have used to add footer in Word document.
As soon as you get these pieces of information to us we'll start our investigation into your issue.
Hi Tahir,
Environment:
- OS: RedHat-6.0
- Architecture: x86_64
- Source code in attached file “Aspose Add Footer.txt”.
Ginka Kyoseva
Hi Ginka,
<span style=“font-size:
10.0pt;font-family:“Courier New”;color:#2B91AF;mso-no-proof:yes”>Document<span style=“font-size:10.0pt;font-family:“Courier New”;mso-no-proof:yes”> doc = new Document(MyDir
- “in.docx”);<o:p></o:p>
addWordFooterWithTabStop2(doc, "");
removePageBreaks(doc);
doc.save(MyDir + "out.docx");
private static void removePageBreaks(Document doc) throws Exception
{
// Retrieve all paragraphs in the document.
NodeCollection paragraphs = doc.getChildNodes(NodeType.PARAGRAPH, true);
// Iterate through all paragraphs
for (Paragraph para : (Iterable) paragraphs)
{
// If the paragraph has a page break before set then clear it.
if (para.getParagraphFormat().getPageBreakBefore())
para.getParagraphFormat().setPageBreakBefore(false);
// Check all runs in the paragraph for page breaks and remove them.
for (Run run : (Iterable) para.getRuns())
{
if (run.getText().contains(ControlChar.PAGE_BREAK))
run.setText(run.getText().replace(ControlChar.PAGE_BREAK, ""));
}
}
}