cycomanic / Menextract2pdf

Extract Mendely annotations to PDF FIles
GNU General Public License v3.0
35 stars 15 forks source link

Exported files without text #20

Open falbarelli opened 4 years ago

falbarelli commented 4 years ago

Hello, thanks for this useful tool.

I am using ubuntu and I used the script "menextract2pdf__overwrite.sh" to overwrite my mendeley library (with the aim of importing it in Zotero, using their native Mendeley importer).

Unfortunately all the pdf files with comments do not have any text at all, you can only see the highlighted portions (but with no text). Is this a known problem?

See one example file here.

cycomanic commented 4 years ago

OK that's interesting. I'll have a look. What's the output of the script?

falbarelli commented 4 years ago

Hi, sorry for the late reply. I did not have time to play with the script again. However, I run the actual python script instead of the bash script for overwriting and it worked fine on the same machine... weird. I'll try again in the next days and I'll let you know.

caufieldjh commented 4 years ago

I experienced the same issue. Running "menextract2pdf__overwrite.sh" or the "menextract2pdf.py" with --overwrite both produced files with only annotations and none of the original document content. Without any attempt to overwrite (i.e., just running menextract2pdf.py) the process completes as expected. It's easy enough to overwrite manually, so thanks for making this script to take care of the difficult part!

chuchong commented 3 years ago

I met the same problem, too. A brutal force solution can be like this:

you can change line 170

outpdf.write(open(fn_out, "wb"))

into

outpdf.write(open(fn_out+"new.pdf", "wb"))

and delete line 165

return