PDFIO.jl icon indicating copy to clipboard operation
PDFIO.jl copied to clipboard

Could not load library "zlib1" The specified module could not be found.

Open charles-r-smith opened this issue 1 year ago • 2 comments

Hello,

When I try to run the below code, I get an error "could not load library "zlib1" The specified module could not be found." I looked and it seems like the library was renamed at some point and that has caused issues with other packages - https://github.com/JuliaIO/GZip.jl/issues/83

Code here:

function getPDFText(src, out) # handle that can be used for subsequence operations on the document. doc = pdDocOpen(src)

# Metadata extracted from the PDF document. 
# This value is retained and returned as the return from the function. 
docinfo = pdDocGetInfo(doc) 
open(out, "w") do io

    # Returns number of pages in the document       
    npage = pdDocGetPageCount(doc)

    for i=1:npage
    
        # handle to the specific page given the number index. 
        page = pdDocGetPage(doc, i)
        
        # Extract text from the page and write it to the output file.
        pdPageExtractText(io, page)

    end
end
# Close the document handle. 
# The doc handle should not be used after this call
pdDocClose(doc)
return docinfo

end

getPDFText(pdf_path, txt_path)

charles-r-smith avatar Jan 21 '25 15:01 charles-r-smith