[ 
https://issues.apache.org/jira/browse/TIKA-4814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18104574#comment-18104574
 ] 

ASF GitHub Bot commented on TIKA-4814:
--------------------------------------

henry-lindeman-glean opened a new pull request, #3018:
URL: https://github.com/apache/tika/pull/3018

   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
   -->
   
   Thanks for your contribution to [Apache Tika](https://tika.apache.org/)! 
Your help is appreciated!
   
   Before opening the pull request, please verify that
   * there is an open issue on the [Tika issue 
tracker](https://issues.apache.org/jira/projects/TIKA) which describes the 
problem or the improvement. We cannot accept pull requests without an issue 
because the change wouldn't be listed in the release notes.
   * the issue ID (`TIKA-XXXX`)
     - is referenced in the title of the pull request
     - and placed in front of your commit messages surrounded by square 
brackets (`[TIKA-XXXX] Issue or pull request title`)
   * commits are squashed into a single one (or few commits for larger changes)
   * Tika is successfully built and unit tests pass by running `./mvnw clean 
test`
   * there should be no conflicts when merging the pull request branch into the 
*recent* `main` branch. If there are conflicts, please try to rebase the pull 
request branch on top of a freshly pulled `main` branch
   * if you add new module that downstream users will depend upon add it to 
relevant group in `tika-bom/pom.xml`.
   
   We will be able to faster integrate your pull request if these conditions 
are met. If you have any questions how to fix your problem or about using Tika 
in general, please sign up for the [Tika mailing 
list](http://tika.apache.org/mail-lists.html). Thanks!
   
   
   
   Tested by running `java -jar tika-app/target/tika-app-4.0.0-SNAPSHOT.jar 
--text Downloadme.onepkg` on this file (renamed so I can upload it lol)
   
[parsing-test.zip](https://github.com/user-attachments/files/31007318/parsing-test.zip)
   
   Before (on simpler version with only the first three pages):
   
   ```
   ❯ java -jar tika-app/target/tika-app-4.0.0-SNAPSHOT.jar --text 
../datasets/onenote/ToDownload/Downloadme.onepkg
   INFO  [main] 12:56:37,927 org.apache.tika.cli.TikaCLI As a convenience, 
TikaCLI has turned on several non-default features
   as specified in 
tika-app/src/main/resources/tika-config-default-single-file.json.
   See: TIKA-2374, TIKA-4017, TIKA-4354 and TIKA-4472).
   This is not the default behavior in Tika generally or in tika-server.
   
   Downloadme/Open Notebook.onetoc2
   
   
   Downloadme/Untitled Section.one
   Highlighted Text
   
   Comic sans
   
   
   
   Downloadme/Section 2.one
   ```
   After
   ```
   ❯ java -jar ~/Glean/tika/tika-app/target/tika-app-4.0.0-SNAPSHOT.jar --text 
parsing-test.zip
   INFO  [main] 16:11:14,757 org.apache.tika.cli.TikaCLI As a convenience, 
TikaCLI has turned on several non-default features
   as specified in 
tika-app/src/main/resources/tika-config-default-single-file.json.
   See: TIKA-2374, TIKA-4017, TIKA-4354 and TIKA-4472).
   This is not the default behavior in Tika generally or in tika-server.
   INFO  [main] 16:11:19,031 org.apache.tika.parser.ocr.TesseractOCRParser 
Tesseract is installed and is being invoked. This can add greatly to processing 
time.  If you do not want tesseract to be applied to your files see: 
https://cwiki.apache.org/confluence/display/TIKA/TikaOCR#TikaOCR-disable-ocr
   
   Users/hmlin/Glean/datasets/onenote/Downloadme/parsing-test/Test section.one
   Page
   
   Wednesday, August 12, 2026
   
   2:29 PM
   
   Image below
   
   
   
   fiew Help Q Tell me what you want to do
   
   vuvy BIU?2Y Av Aes
   
   Page
   
   ap GEARED Wednesday, August 12,
   
   
   
   
   /iew
   Help
   Tell me what you want to do
   V
   11
   v
   BIU QVA A .
   Page
   + Add page
   Wednesday, August 12,
   
   Image above
   
   
   
   
   
   
Users/hmlin/Glean/datasets/onenote/Downloadme/parsing-test/parsing-test.onetoc2
   
   
   Users/hmlin/Glean/datasets/onenote/Downloadme/parsing-test/Section-1.one
   Page 1
   
   Wednesday, August 12, 2026
   
   10:24 AM
   
   Text
   
   More text
   
   Bold Text
   
   Italic Text
   
   Underlined test
   
   Red text
   
   Highlighted text
   
   
   
   ----------------------------------------
   
   Page sdskgjhsdlf
   
   Wednesday, August 12, 2026
   
   10:26 AM
   
   Bullet 1
   
   Bullet 2
   
   Indented bullet
   
   Indented square
   
   Number 1
   
   Number 2
   
   Letter a
   
   Numeral I
   
   Outdented number
   
   More text
   
   Table cell 1a
   
   Table cell 4a
   
   Table cell 2b
   
   Table cell 3b
   
   Table cell 4b
   
   Comic sans
   
   
   
   
   
   Users/hmlin/Glean/datasets/onenote/Downloadme/parsing-test/Section-2.one
   Page 1
   
   Wednesday, August 12, 2026
   
   10:28 AM
   
   Idk
   
   
   
   ----------------------------------------
   
   Pictures or something
   
   Wednesday, August 12, 2026
   
   10:29 AM
   
   
   
   Table 2. Basic dimensions for car side counterweight layouts with speed up 
to 1.75 m/s
   
   tar
   
   Le a nr a a
   (ka) (m) BB x DD (mm) type: (ey! (mm) FWi FW2 FWi FW2 WW wo” WW WD
   Sar a ep Cr to Saar
   eS Ce gee Cae a at eee
   emo Bea EL eae ee sl a al
   stn eee at ea ee
   
   ee ime ee Pee me tae ae Toe Coe ae i aoe ele
   
   ieee Fea eH ie ee a es ee eB
   
   pen HRB pe Hi a
   ep (ie re Tee eat ae ian ae oe ee at oe ele
   
   wenam PROTEST cco Lee teat ae aS a a Tet a
   Be ear se Ce ee ee rae ae ae Ce ae st eal
   
   a pet er eae a om a ee
   
   Tem rive ERE CEI wee HSH eee ae et et
   be reer| se Parte Cee tree ee tee Cae ee et ee
   
   HE ec EH a ae a i
   
   a ee ee ne ee ee
   
   en EER CET re Fe tga tm ae a ee et oe al
   SE te a
   eee ae Peete et ae ae ee et ee
   Tense HEE ap Heh Cee ie aaa ee oe ee
   ee ee eae eee
   
   pee ER te ee et ee
   a
   
   A eg a
   
   seenee HEE 2 FRE as ee Ce ar eae
   Se ee eee ee ee ete eee
   
   a aco EEE tea eet ret tae tai aa
   
   sem ee a ae aie meee el
   
   we | fa an i ae ee ee eel
   
   wea ce Pet ge me a re ee a
   veeterono EaR| O FCEEE e Sa
   See ae en ee ee ee ee
   tetas Ca ge a Ce ae ge ae a
   
   tem ia oe Can ae er ie ee a lt ale
   
   ee ee ee
   ee a ee eee ae ae ea ee
   
   eee ae re eae
   
   mene Poet] Eee tee eee ie ee et a
   Soi) Cee ee ie ae re ee ee
   
   oa ee ee a en ee PE
   
   TH ee Ce ae ae Ce ae ae ae et a ele
   nasnem ae“? Cee tae eh ie oe ae et a el
   moi) Cah eee a Cie ae Ca re ee et re ei
   
   em A Pe
   RR eB re Leet ete aa re ie a
   eee eae re eae eee ae ee Cae et ae ees
   oe ne, ee EE
   eae ee ee
   A eee ee
   
   weenam REET oxo Petes teeta aee oe atc fet te et
   wet | ea ae ein ae aa re a i ea
   
   Tee ne RE CRERT wee ESTES ie age ie at a
   top ige| a ae ae ge aa ea it ei
   
   eer] 2 Seta aera (ie Cae eer a
   
   
   
   
   
   This is a picture of a table
   
   Here's some floating text
   
   
   
   ----------------------------------------
   
   Very wide
   
   Wednesday, August 12, 2026
   
   10:31 AM
   
   Hello
   
   Hello
   
   Hello
   
   Hello
   ```
   Images of the pages in the notebook
   <img width="837" height="381" alt="image" 
src="https://github.com/user-attachments/assets/8d194b67-d5aa-41e8-a811-d2cb60cf1eb9";
 />
   <img width="837" height="401" alt="image" 
src="https://github.com/user-attachments/assets/affbec56-9c19-4e61-aaaa-58f0a851e5cc";
 />
   <img width="837" height="307" alt="image" 
src="https://github.com/user-attachments/assets/97c22372-67cf-4810-ab45-bec3e1974307";
 />
   <img width="837" height="876" alt="image" 
src="https://github.com/user-attachments/assets/5cf514b6-edb0-4a05-8fc4-ac5ffb0179a3";
 />
   <img width="1627" height="519" alt="image" 
src="https://github.com/user-attachments/assets/7adfec70-f80d-469f-85cf-1174461a96d3";
 />
   <img width="837" height="519" alt="image" 
src="https://github.com/user-attachments/assets/e6529e45-727c-4ecc-a4bd-7784faa560e5";
 />
   
   (the last page is added as a test fixture in this PR - 
testOneNoteEmbeddedImage.one)
   
   It appears that the earlier behavior was to only take the last item on each 
page? (and since the last item on s2p1 is a drawing it gets null text there)




> Onenote parsing only takes last item on each page
> -------------------------------------------------
>
>                 Key: TIKA-4814
>                 URL: https://issues.apache.org/jira/browse/TIKA-4814
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 3.3.2
>         Environment:  
> {code:java}
> ❯ java --version
> openjdk 26.0.2 2026-07-21 OpenJDK Runtime Environment Homebrew (build 26.0.2) 
> OpenJDK 64-Bit Server VM Homebrew (build 26.0.2, mixed mode, sharing)
> ❯ uname -a
> Darwin Henrys-MBP.localdomain 25.6.0 Darwin Kernel Version 25.6.0: Sat Jul 11 
> 15:25:34 PDT 2026; root:xnu-12377.161.13~4/RELEASE_ARM64_T6020 arm64{code}
>            Reporter: Henry Lindeman
>            Priority: Major
>         Attachments: Downloadme.onepkg
>
>
> I made a test onenote file and tried to parse it with the cli as described in 
> the tika readme, and it only showed the last element on each page
> {code:java}
> ❯ java -jar tika-app/target/tika-app-4.0.0-SNAPSHOT.jar --text 
> ../datasets/onenote/ToDownload/Downloadme.onepkg
> INFO [main] 12:56:37,927 org.apache.tika.cli.TikaCLI As a convenience, 
> TikaCLI has turned on several non-default features
> as specified in 
> tika-app/src/main/resources/tika-config-default-single-file.json.
> See: TIKA-2374, TIKA-4017, TIKA-4354 and TIKA-4472).
> This is not the default behavior in Tika generally or in tika-server.
> Downloadme/Open Notebook.onetoc2
> Downloadme/Untitled Section.one
> Highlighted Text
> Comic sans
> Downloadme/Section 2.one 
> {code}
> onedrive sharing link: 
> [Downloadme|https://1drv.ms/o/c/98705a8ca0add89e/IgBEW7OVk9slSKq8sJeJUTkbAQ6K3mNiiRNLGRNh5sniyq0?e=g3aSgg]
>  
> I also vibe-coded a fix for this. lmk if you want it. 
> [https://github.com/henry-lindeman-glean/tika/pull/1] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to