Last active
October 10, 2020 07:57
-
-
Save GroupDocsGists/313e9882bedaa1e65c5a540d4f30c8b0 to your computer and use it in GitHub Desktop.
Embed Document into Word Document as OLE Object using Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Embed PDF into a Word Document as an OLE object | |
int pageNumber = 1; | |
OleWordProcessingOptions oleWordsOptions = new OleWordProcessingOptions("PDF-document.pdf", pageNumber); | |
oleWordsOptions.setWidth(200); // Setting the width and height of embedded document | |
oleWordsOptions.setHeight(200); | |
// Import the PDF into Word Document | |
Merger merger = new Merger("document.docx"); // Source Word document | |
merger.importDocument(oleWordsOptions); | |
merger.save("output-document.docx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment