Free Support Forum - aspose.com

Style.addCopy error 2!

Hi there,
In contnuation with our previous post on Style.addCopy() error - we found some more issues with separate document.

Issues are highlighted in code with bold formatting.

Please find the attached documents and try following code:

public static void main(String[] args) {
String dirUrl = “Desktop\Iteration33\TextComparison\New folder\”; //TexBox Quest\"; //\HF\";
String docxUrl = “Bug_H1H2H3”;
String doclet = “Blank”;

Document doc, docletDoc, pageDoc = null;
DocumentBuilder db = null;
try {
doc = new com.aspose.words.Document(dirUrl + docxUrl + “.docx”);

docletDoc = new com.aspose.words.Document(dirUrl + doclet + “.docx”);

for (Style s : doc.getStyles()) {
docletDoc.getStyles().addCopy(s);
}

System.out.println("–");
// PROBLEM WITH H1 LINE SPACING
System.out.println(doc.getStyles().get(“H1”).getParagraphFormat().getLineSpacing()); // 12
System.out.println(docletDoc.getStyles().get(“H1”).getParagraphFormat().getLineSpacing()); // 13.8

// PROBLEM WITH H2 LINE SPACING
System.out.println(doc.getStyles().get(“H2”).getParagraphFormat().getLineSpacing()); // 12
System.out.println(docletDoc.getStyles().get(“H2”).getParagraphFormat().getLineSpacing()); // 13.8

// PROBLEM WITH H3: {INDENT, TAB POSITION, NUMBER FORMAT, NUMBER POSITION}
System.out.println(doc.getStyles().get(“H3”).getParagraphFormat().getFirstLineIndent()); // -21.6
System.out.println(docletDoc.getStyles().get(“H3”).getParagraphFormat().getFirstLineIndent()); // 25.2

System.out.println(doc.getStyles().get(“H3”).getParagraphFormat().getLeftIndent()); // 53.1
System.out.println(docletDoc.getStyles().get(“H3”).getParagraphFormat().getLeftIndent()); // 79.2


System.out.println(System.currentTimeMillis());
}

catch (Exception e) {
throw new RuntimeException(“Aspose document instance problem”, e);
}
}

Please have a look. Thanks.

Hi Praneeth,


Thanks for your inquiry. “PROBLEM WITH H1 LINE SPACING” and “PROBLEM WITH H2 LINE SPACING” are not reproducible when using latest version of Aspose.Words for Java 14.11.0 on our end. Please upgrade to the latest version from the following link. I hope, this helps.
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

However, we managed to reproduce the “PROBLEM WITH H3” problem on our end. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-11260. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-11260) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.