# Word Documents and PDFs in Julia

**URL:** https://discourse.julialang.org/t/word-documents-and-pdfs-in-julia/118175
**Category:** New to Julia
**Created:** [August 14, 2024, 10:56am UTC](https://discourse.julialang.org/t/word-documents-and-pdfs-in-julia/118175 "2024-08-14T10:56:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Finseth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_finseth/32/210036_2.png) [@John\_Finseth](https://discourse.julialang.org/u/John_Finseth)
#### Post date: [August 14, 2024, 10:56am UTC](https://discourse.julialang.org/t/word-documents-and-pdfs-in-julia/118175/1 "2024-08-14T10:56:43Z")

</div>

I’m working with folders of PDFs and .docx documents in Julia. I’ve been trying to find some packages to help me deal with this, but I only really found Docx (I’ve taken care of the PDFs). While I can the documents with Docx, I’d like to be able to get more than plain text, like word count, page count, etc. Are there any better packages for handling word documents in Julia or getting this info with Docx? Thanks.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [August 14, 2024, 6:30pm UTC](https://discourse.julialang.org/t/word-documents-and-pdfs-in-julia/118175/2 "2024-08-14T18:30:17Z")

</div>

I wrote WriteDocx.jl so I know a bit about these files now, however that package only involves writing them and not reading them.

They are just zip files with a couple xml files in them, and these xml files can be opened with packages such as EzXML.jl

While a word count could be relatively easy (go through all w:t tags and count the words in their content strings) you cannot get page counts this way because there are no pages in docx files. The pages are the result of feeding the content through the layouting algorithm of Word, but you don’t have access to that.

---

<div class="post-metadata">

### Author: ![jbytecode](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbytecode/32/17719_2.png) [@jbytecode](https://discourse.julialang.org/u/jbytecode)
#### Post date: [August 14, 2024, 6:50pm UTC](https://discourse.julialang.org/t/word-documents-and-pdfs-in-julia/118175/3 "2024-08-14T18:50:31Z")

</div>

I think somebody in the community may try to wrap Apache POI ([https://poi.apache.org/](https://poi.apache.org/)) using the JavaCall package of Julia for a full control on the office files.

---

<div class="post-metadata">

### Author: ![dawbarton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dawbarton/32/215461_2.png) [@dawbarton](https://discourse.julialang.org/u/dawbarton)
#### Post date: [August 14, 2024, 7:15pm UTC](https://discourse.julialang.org/t/word-documents-and-pdfs-in-julia/118175/4 "2024-08-14T19:15:08Z")

</div>

There is already [Taro.jl](https://github.com/aviks/Taro.jl) that wraps various Apache libraries in this area.

---

<div class="post-metadata">

### Author: ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)
#### Post date: [August 15, 2024, 4:06am UTC](https://discourse.julialang.org/t/word-documents-and-pdfs-in-julia/118175/5 "2024-08-15T04:06:05Z")

</div>

Thinking a bit outside the box: If you can handle the pdfs already, wouldn’t it be easiest to just convert the .docx to pdf and then analyse the pdf version?  
You can probably do this automatically via pandoc (there is a Julia binding Pandoc.jl but I don’t know it’s status).
