adasilva / journal2ebook Goto Github PK
View Code? Open in Web Editor NEWoptimize academic pdfs for e-readers
License: Other
optimize academic pdfs for e-readers
License: Other
can we reduce the resolution to make it faster? Or is this not the underlying issue?
Changed: os.system('convert "%s.pdf" temp.png' % self.filename)
To: subprocess.call(['convert', self.filename+'.pdf', imFile])
Putting the filename in quotes within subprocess.call function ('"'+self.filename+'.pdf"') gives an error for me. Can you confirm that removing the quotes and changing to subprocess still works for you?
I have cloned the project into a directory; but when I try python journal2ebook.py , I get this error:
from PIL import ImageTk
ImportError: cannot import name ImageTk
I am running Python 2.7.6 (default, Mar 22 2014, 22:59:56), under Ubuntu 14.04
PIL.VERSION shows 1.1.7
Hi,
is this project still alive?
Personally, I'm interested in this project and could look into updating it to python3 etc.
BR,
Constantin
While launching after the given install steps, I had to manually change the source to import ImageTk as follows:
- import ImageTk
+ from PIL import ImageTk
Not sure whether this works for all distributions so not sending a pull request.
I wonder if it's possible to get a more featureful open box (e.g., sort by date modified, type letters to zoom to the potential file)
After processing, change the preview image to the new pdf. Or should it be in its own box? (A toggle between original pdf and new pdf?)
Use pdftk to allow (e.g.) removal of extra pages.
Pass a button click to the terminal after running k2pdfopt?
Accidentally pressed New File and chose an invalid filename. Then clicked Ready to convert. Received this error:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1473, in call
return self.func(*args)
File "journal2ebook.py", line 497, in bReadyClick
subprocess.call(['k2pdfopt','-x','-col', str(n), '-ml', str(leftmargin), '-mr', str(rightmargin), '-mt', str(topmargin), '-mb', str(bottommargin), '-ui-','-o', newFileName, '"'+self.filename+'.pdf"'])
TypeError: cannot concatenate 'str' and 'tuple' objects
Position top/bottom margin scale bars on the left of the page image
When I click ready as an epub, I still get a pdf.
Compatible with windows if the following are true:
*PIL is installed
*ImageMagick for windows is installed
*k2pdfopt.exe is in the windows path or included with journal2ebook
Window size should be flexible and easily adjustable (by clicking and dragging the window box). When the window size is adjusted, the pdf image size should adjust with it.
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1437, in call
return self.func(*args)
File "journal2ebook.py", line 296, in bNewFileClick
newFilename=self.chooseImage(initdir=self.filedir)
TypeError: chooseImage() got an unexpected keyword argument 'initdir'
Related to issue #26
Traceback (most recent call last):
File "journal2ebook.py", line 423, in
myapp=Journal2ebook(root)
File "journal2ebook.py", line 50, in init
self.configVars={line.split(':')[0].replace(' ',''):line.split(':')[1].lstrip().rstrip('\n') for line in f} #dictionary of configuration variables
File "journal2ebook.py", line 50, in
self.configVars={line.split(':')[0].replace(' ',''):line.split(':')[1].lstrip().rstrip('\n') for line in f} #dictionary of configuration variables
IndexError: list index out of range
e.g. from zotero - started work in branch master (see file grabMetadata.py)
Sometimes journal profiles need to be modified. Right now if you type the same name it just duplicates. Might be good to ask about overwrite
A particular journal will likely have parameters that work for all articles in that journal. It would help to save the parameters for a particular journal, and add bulk conversion. (Can we read pdf metadata to get the journal? This might work best as a plugin for a reference manager.)
fixed by just using () instead of '' to skip changing the image if cancel is pushed.
I'm trying to get journal2ebook working on Ubuntu 18.04 and it exits with the error below when trying to load a PDF.
convert-im6.q16: not authorized
/home/troy/Documents/some-file.pdf' @ error/constitute.c/ReadImage/412. convert-im6.q16: no images defined
/home/troy/Documents/tempfiles/temp.png' @ error/convert.c/ConvertImageCommand/3258.
Couldn't load file: [Errno 2] No such file or directory: '/home/troy/Documents/tempfiles/temp.png'
Traceback (most recent call last):
File "/usr/local/bin/journal2ebook", line 481, in
myapp=Journal2ebook(root,filename)
File "/usr/local/bin/journal2ebook", line 94, in init
self.setup()
File "/usr/local/bin/journal2ebook", line 102, in setup
self.prepImage()
File "/usr/local/bin/journal2ebook", line 268, in prepImage
self.imgaspect = float(self.img.size[0]) / float(self.img.size[1])
AttributeError: 'NoneType' object has no attribute 'size'
There seems to be a caret under the word "for"
I am only a beginner at linux, so I need somewhat explicit directions.
I do have a tessdata folder,
/Applications/VietOCR3 App/tesseract-ocr/tessdata
(But I havent been able to get vietocr3 to work. another story)
How do I set the tessdata_prefix??
thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.