Bug 60914 - DOC TO PDF
Summary: DOC TO PDF
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: 3.15-FINAL
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-24 11:17 UTC by pooja.dhannawat535
Modified: 2017-03-24 11:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pooja.dhannawat535 2017-03-24 11:17:04 UTC
Is there any way to convert .doc to .pdf.
I tried using fo also but in that case I got issues with images in output pdf.
Images were coming in output .fo file as I have overridden the method as follows -

public class CustomImageWordToFoConverter extends WordToFoConverter {
    public CustomImageWordToFoConverter(Document document) {
        super(document);
    }
    @Override
    protected void processImageWithoutPicturesManager(Element currentBlock,
                                                      boolean inlined, Picture picture)
    {
        Element imgNode = currentBlock.getOwnerDocument().createElement("img");
        StringBuilder sb = new StringBuilder();
       sb.append(Base64.getMimeEncoder().encodeToString(picture.getRawContent()));
        sb.insert(0, "data:"+picture.getMimeType()+";base64,");
        imgNode.setAttribute("src", sb.toString());
        currentBlock.appendChild(imgNode);
    }
} 

Please suggest best way to convert .doc to .pdf with all formatting and images retained in outout
Comment 1 Tim Allison 2017-03-24 11:26:12 UTC
Please ask these types of questions on our users list: user@poi.apache.org.  The issue tracker is for reporting problems or requesting new features.