Question

4
Replies
1123
Views
Bhanu Prakash G (Prakash.)
Process 360
Senior Consultant
Process 360
IN
Prakash. Member since 2012 6 posts
Process 360
Posted: December 26, 2016
Last activity: April 14, 2017
Posted: 26 Dec 2016 11:34 EST
Last activity: 14 Apr 2017 7:45 EDT
Closed
Solved

Need help in converting docx to pdf using docx4j api

The following exceptions are recorded while trying to convert docx to pdf.


Pega 7.2


Exceptions:

The following exceptions are recorded while trying to convert docx to pdf.

Pega 7.2

Exceptions:

2016-12-26 17:22:05,849 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.fo.XsltFOFunctions.createBlockForPPr(reference, node-set, string, result-tree)' 
2016-12-26 17:22:05,851 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.fo.XsltFOFunctions.createBlockForRPr(reference, node-set, node-set, result-tree)' 
2016-12-26 17:22:05,851 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.common.XsltCommonFunctions.fontSelector(reference, node-set, node-set, node-type)' 
2016-12-26 17:22:05,853 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.fo.XsltFOFunctions.createBlockForSdt(reference, node-set, string, result-tree, string)' 
2016-12-26 17:22:05,854 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.fo.XsltFOFunctions.createBlockForSdt(reference, node-set, string, result-tree, string)' 
2016-12-26 17:22:05,855 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.fo.XsltFOFunctions.createInlineForSdt(reference, node-set, result-tree, string)' 
2016-12-26 17:22:05,856 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.common.XsltCommonFunctions.notImplemented(reference, node-type, string)' 
2016-12-26 17:22:05,857 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.common.XsltCommonFunctions.notImplemented(reference, node-type, string)' 
2016-12-26 17:22:05,858 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.common.XsltCommonFunctions.updateComplexFieldDefinition(reference, node-type)' 
2016-12-26 17:22:05,859 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.common.XsltCommonFunctions.notImplemented(reference, node-type, string)' 
2016-12-26 17:22:05,860 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (           org.docx4j.XmlUtils) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Cannot convert argument/return type in call to method 'org.docx4j.convert.out.common.XsltCommonFunctions.notImplemented(reference, node-type, string)' 
2016-12-26 17:22:05,861 [fault (self-tuning)'] [TABTHREAD5] [                    ] [testapp:01.01.01] (   out.common.AbstractExporter) ERROR XXX.XXX.X.X|XXX.X.X.X user26 - Exception exporting package  
 
 

Code:

try {
            
 
            java.io.InputStream is = new java.io.FileInputStream(new  java.io.File("/temp/testing.docx"));
			org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage = org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(is);
 			 			           
            java.io.OutputStream out = new java.io.FileOutputStream(new java.io.File("/temp/HelloWorld2.pdf"));
           	org.docx4j.Docx4J.toPDF(wordMLPackage, out);
 
            
 
        } catch (Throwable e) {
  			oLog.error("Exception while creating pdf:"+e.toString());
  			
        }

***Updated by moderator: Lochan to remove proprietary information; add SR details***

Data Integration Java and Activities Support Case Created
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.