Question

4
Replies
1014
Views
Prakash. Member since 2012 6 posts
Process 360
Posted: 3 years ago
Last activity: 3 years 6 months ago
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:

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 SR Created
Moderation Team has archived post
Share this page LinkedIn