Document.copyStylesFromTemplate API throwing null pointer exception

Hi,

We are using Document.copyStylesFromTemplate(Document template) whch is throwing NullPointerException.

Please find the sample code below:

 public void testCopyStylesFromTemplate() throws Exception {
        Document sampleDoc = new Document("sample.docx");
        Document wordDoc = new Document("target.docx");
       
        wordDoc.copyStylesFromTemplate(sampleDoc);
       
    }

Please find documents in attachment Documents.zip (25.7 KB)
.

Looking forward to your reply.

Thanks
Manisha

@oraspose

We have tested the scenario using the latest version of Aspose.Words for Java 19.7 and have not faced the shared issue. So, please use Aspose.Words for Java 19.7.