Word document creation from AEM 6.2

Avatar

Avatar
Validate 1
Level 1
swaminathn19917
Level 1

Likes

0 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
swaminathn19917
Level 1

Likes

0 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
swaminathn19917
Level 1

19-09-2016

We have a requirement to generate PDF and Word document from AEM 6.2. Is it possible to generate a word document from AEM directly or with help of any add on packages?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,200 likes

Total Posts

6,394 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,200 likes

Total Posts

6,394 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

20-09-2016

Hi, there is no direct OOTB/Service available in AEM for this.

But, you can create a custom service/Component to achieve it.

There is Apache POI library for read,writ,create and manage MS-Word documents using Java.

Link doe Tutorial :- http://www.tutorialspoint.com/apache_poi_word/apache_poi_word_document.htm

//Example ti create a blank Document

import java.io.File;
import java.io.FileOutputStream;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

public class CreateDocument
{
   public static void main(String[] args)throws Exception
   {
   //Blank Document
   XWPFDocument document= new XWPFDocument();
   //Write the Document in file system
   FileOutputStream out = new FileOutputStream(
   new File("createdocument.docx"));
   document.write(out);
   out.close();
   System.out.println(
   "createdocument.docx written successully");
   }
}

Now just create a OSGi sling service or component and use above library to read,writ,create and manage MS-Word documents.

Please have a look at this forum post:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 1
swaminathn19917
Level 1

Likes

0 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
swaminathn19917
Level 1

Likes

0 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
swaminathn19917
Level 1

20-09-2016

Will try the above options and revert back in case of any issues.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

19-09-2016

AEM does not generate Word docs. To achieve this use case, you would need to build a custom AEM service and use a Java Word API as part of that service -- such as: 

https://poi.apache.org/

As a guideline - we have a article with a similar use case - its building a custom AEM service that uses integrates the Excel API. See: 

https://helpx.adobe.com/experience-manager/using/creating-custom-excel-service-experience.html

Hope this helps...