Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 36A47200D41 for ; Wed, 22 Nov 2017 11:06:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 35160160BFD; Wed, 22 Nov 2017 10:06:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7B358160BDA for ; Wed, 22 Nov 2017 11:06:38 +0100 (CET) Received: (qmail 13579 invoked by uid 500); 22 Nov 2017 10:06:32 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Delivered-To: moderator for user@poi.apache.org Received: (qmail 33499 invoked by uid 99); 22 Nov 2017 05:04:19 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.685 X-Spam-Level: *** X-Spam-Status: No, score=3.685 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, KB_WAM_FROM_NAME_SINGLEWORD=0.2, NML_ADSP_CUSTOM_MED=1.2, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.972, URI_HEX=1.313] autolearn=disabled Date: Tue, 21 Nov 2017 22:04:16 -0700 (MST) From: nilez To: user@poi.apache.org Message-ID: <1511327056249-0.post@n5.nabble.com> Subject: How to create oleObject1.bin for Word (.docx) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Wed, 22 Nov 2017 10:06:39 -0000 Hi all, I am new for poi. I would like to insert objects in Microsoft word (.docx) using java. In the editor, I can insert object (from several file types) by going to menu : *Insert > Object...* Following are structure of each object in *\word\embeddings\* when I have tried to insert /file.docx, file.odt, and file.pdf/ *\word\embeddings\* - Microsoft_Word_Document1.docx - oleObject1.bin - oleObject2.bin Structure of oleObject1.bin *\word\embeddings\oleObject1.bin\* - [1]CompObj - [1]Ole - package_stream - [3]ObjInfo - properties_stream Structure of oleObject2.bin *\word\embeddings\oleObject2.bin\* - [3]EPRINT - [1]Ole - [3]ObjInfo - [1]CompObj - CONTENTS I see the example to create oleObject1.bin in TestEmbed.addHtml() from This link And I have tried to create my code as below to create sample oleObject1.bin When I try to create ole object from .odt file The output is oleObject1.bin but its structure does not match to oleObject1.bin that is created by editor *\word\embeddings\oleObject1.bin\* - [1]Ole10Native However the structure of o/leObject1.bin\[1]Ole10Native/ (from my code) match to /oleObject1.bin\package_stream/ (from structure) This is my misunderstand about oleObject and POI APIs. I wonder that 1. How file (several type) is stored in Word? It seem the embedded object from each file type has different format and structure. - file.docx ---> embedded.docx - file.odt, file.pdf ---> oleObject1.bin (stored as binary but contain different structure) 2. How to decide the structure of oleObject1.bin from each file type? For example: file.odt and file.pdf, they are stored as same format but contain different sub-files and sub-directories. Where can i find the specification to create ole object from each file type? - oleObject1.bin from file.odt - [1]CompObj - [1]Ole - package_stream - [3]ObjInfo - properties_stream - oleObject2.bin from file.pdf - [3]EPRINT - [1]Ole - [3]ObjInfo - [1]CompObj - CONTENTS 3. Can I create the complete oleObject1.bin (including its sub-files or sub-directories) using POI library? How to do that? How to create [1]CompObj, [1]Ole, [3]ObjInfo, ... etc.? Thanks in advance ----- Best regards, Nilez -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org