Question

3
Replies
850
Views
Close popover
Anuradha Withanage (AnuradhaW)
Virtusa

Virtusa
LK
AnuradhaW Member since 2015 33 posts
Virtusa
Posted: July 30, 2018
Last activity: July 31, 2018
Closed

I want to Convert Attached word document to PDF

Actually, I have a scenario to convert Attached word document to PDF. I'm try to do it using Apache POI,my code is not working .

try
{
PRFile file1 = new PRFile(FileName);
PRInputStream doc = new PRInputStream(file1);
// 1) Load docx with POI XWPFDocument
com.pega.apache.poi.xwpf.usermodel.XWPFDocument document = new com.pega.apache.poi.xwpf.usermodel.XWPFDocument(doc);
PRFile outFile = new PRFile(FileName);
PROutputStream out = new PROutputStream ( outFile );
com.pega.apache.poi.xwpf.converter.pdf.PdfOptions options = com.pega.apache.poi.xwpf.converter.pdf.PdfOptions.create().fontEncoding( "windows-1250" );
com.pega.apache.poi.xwpf.converter.pdf.PdfConverter.getInstance().convert( document, out, options );
}
catch ( Throwable e )
{
e.printStackTrace();
}
Pega Knowledge Conversational Channels Low-Code App Development Data Integration Java and Activities DevOps Testing Applications
Moderation Team has archived post,
Close popover 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.