PDFIO pdPageExtractText

Does anybody work with PDFIO.jl?
I need to extract text from pdf, due to limiting of my knowledge, I don’t understand how to use the method to save text to string, which is printing to REPL.

 doc = pdDocOpen("test.pdf")
 page = pdDocGetPage(doc, 1)
 dPageExtractText(stdout, page)

the first argument to dPageExtractText is stdout indicating that the output is printed. If you want to capture the output, you may try something like this

io = IOBuffer()
dPageExtractText(io, page)
String(take!(io))

note, that I have not tried this, but something like that should work.

1 Like

Thank you .
only, it should be String() not string()

2 Likes