Question

3
Replies
715
Views
AnuradhaW Member since 2015 32 posts
Virtusa
Posted: 2 years ago
Last activity: 2 years 2 months ago
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 Low-Code App Development Testing Applications
Moderation Team has archived post
Share this page LinkedIn