Expand my Community achievements bar.

Docx to PDF conversion issue

Avatar

Level 1

Hi All,

 

          I’m working on DOCX to PDF conversion on workflow, facing a strange issue. I’m able to convert to PDF but images in given DOCX  are missing in converted PDF. its working as expected when I ran as a standalone java program. it happening only when I ran thru on AEM. I’m using following dependencies, AEM version is 6.1

 

<dependency>

                                <groupId>org.apache.poi</groupId>

                                <artifactId>poi</artifactId>

                                <version>3.11</version>

                </dependency>

                <dependency>

                                <groupId>org.apache.poi</groupId>

                                <artifactId>poi-ooxml-schemas</artifactId>

                                <version>3.11</version>

                </dependency>

 

Java Code:

 

FileInputStream in=new FileInputStream("D:\\docs\\doc1.docx");

        XWPFDocument document=new XWPFDocument(in);

       

        File outFile=new File("D:\\docs\\DocxStructures_1.pdf");

       

        OutputStream out=new FileOutputStream(outFile);

        PdfConverter.getInstance().convert(document,out,options);

 

The above code work fine as standalone java program. Is anything I’m missing? am I missing any config updates? Any pointers would be greatly helpful.

 

Thanks in Advance!

3 Replies

Avatar

Level 10

Have you tried writing a custom workflow step that uses this Java API. That should make it successful in a workflow.

Avatar

Level 1

Yep, I created as custom WorkflowProcess only but looks like this is referring old jar not latest jar I've added. Is there anyway to override this?

 

Thanks!

Avatar

Level 1

Hi Team,

I created a Custom Workflow Steps and we are able to create the rendition but the image formatting, the fonts and layout gets messed up. I tried with both POI/xdocreport. Are there any Adobe PDF generator APIs which i can use to create my PDF renditions from a Word DOCX file? Please advise

Thanks,

Mitul