https://bz.apache.org/bugzilla/show_bug.cgi?id=60914

            Bug ID: 60914
           Summary: DOC TO PDF
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HWPF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to