01-01-2011, 10:23 PM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
AttributeError: 'PDFWriter' object has no attribute 'get_printer'
When I attempt to convert to PDF, I receive the error:
AttributeError: 'PDFWriter' object has no attribute 'get_printer' I received the same result when attempting to convert a (non-DRM) EPUB and a (non-DRM) MOBI. I'm running calibre version 0.7.36, on Windows XP SP3. I do not currently have a Python installed on this PC. Is there a work-around available? TIA |
01-01-2011, 11:13 PM | #2 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: none (Kindle?)
|
Same problem
I was using 7.12, trying to convert epub to pdf. It kept giving me zero length files. I found the newest version, 7.36, with the handy install command for Linux (Thanks! ), and tried again.
I get the same error message as klinefelter. The progress bar at job info stays stuck at 67%. I tried converting an html to pdf, but all it does is put the <h2>header in a table-of-contents, but there are no contents. The job says it's 100% completed. I have python 2.6. I don't remember the dependencies too well, but I did read through them and I'm pretty sure I have them all. The other error message I've gotten is a refusal to display because it's a DRM'ed file. This is my own writing, and I certainly haven't been aware of DRMing anything. I don't remember the exact circumstances that time. I've been trying things, one after the other and not taking notes ... but I see the perfect smilie over there ... |
Advert | |
|
01-02-2011, 09:58 AM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
I Think I See The Problem and a Sometimes Work-around
When converting a book without a cover in the source file, setting the "Use cover from source file" option creates a PDF without a cover, and without an error. Sadly, when converting a book WITH a cover in the source file, setting this option does not improve the situation.
It looks to me like src/calibre/ebooks/pdf/writer.py has a bug in insert_cover (line 174 in the downloaded source), where Code:
printer = self.get_printer() Code:
printer = get_pdf_printer(self.opts) |
01-02-2011, 10:00 AM | #4 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
It's a bug and there is no way around it. I've corrected it in my branch. Should make it into the next release.
|
01-02-2011, 10:28 AM | #5 |
Junior Member
Posts: 3
Karma: 10
Join Date: Jan 2011
Device: Kindle
|
Work-around
Since I'm using Windows, I had to read up on how to use CALIBRE_DEVELOP_FROM before I could work around it. For other Calibre newbies (and those who just want to *use* Calibre), here's how to work-around this issue:
|
Advert | |
|
01-02-2011, 05:22 PM | #6 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: none (Kindle?)
|
Kudos!
You folks are the best! :
I can't wait to get this working. I run ubuntu, so I'm trying to transpose to that system, but I'm a bit too ignorant. I'm not sure I'm setting the environment variable right. I've tried at the command line as user and as root. It doesn't show up when I say "printenv" so I assume I've done something wrong. This is what I tried: Code:
$CALIBRE_DEVELOP_FROM=/opt/calibre/src/ Code:
$sudo CALIBRE_DEVELOP_FROM=/opt/calibre/src/ Code:
#CALIBRE_DEVELOP_FROM=/opt/calibre/src/ What should I be doing different? |
01-02-2011, 05:43 PM | #7 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
export CALIBRE_DEVELOP_FROM=/opt/calibre/src/
Also you will want to have the source files owned by your user. It would be better to have it some place in your home directory instead of opt. |
01-02-2011, 05:55 PM | #8 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: none (Kindle?)
|
Thanks for that info. Yeah, I see, after a better search that I was doing the env var all wrong. I made the changes, but they require a reboot to take effect, and my machine is in the process of doing a huge backup. Once that's done and I can reboot (some time tomorrow??), I'll come back and report on progress.
So, if I understand right, I could just set the env var to point to the location of the source files in my /home, even though the program itself is in /opt/calibre/ ? I.e. for instance Code:
export CALIBRE_DEVELOP_FROM=/home/quixote/dwnlds/calibre/src |
01-02-2011, 05:57 PM | #9 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Not necessarily. If you added it to your bashrc (or bash_profile) file you don't need to reboot. Just open a new terminal and run calibre from there. If you put in in the global bashrc in /etc just type the export and you're good to go for the life of that terminal window.
Yep. |
01-02-2011, 07:08 PM | #10 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: none (Kindle?)
|
I tried running without a reboot. Printenv still doesn't show the variable (it should, shouldn't it?), and calibre still hangs on the pdf conversion with the same error. I'll wait till after a reboot before I start worrying, though.
|
01-02-2011, 10:44 PM | #11 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
FYI, while you were busy setting up to run from source, version 0.7.37 was released that corrected the PDF conversion problem.
|
01-03-2011, 02:28 PM | #12 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: none (Kindle?)
|
When I rebooted, the env variable existed. Sadly, the pdf still stalled at the same error message.
So, I tried 7.37. (The handy linux installer hasn't caught up yet.) The good news is that version does produce a pdf! The bad news is that it seems to lose all the links. And the headers aren't found. There are no chapter breaks, and the TOC contains only the filename. The headers in the convert routine are found in other formats (eg .mobi). I'll try to examine the settings on the pdf part more closely to see if it's something I did wrong. Still, this is definitely progress. Update: a thought occurs to me. The env variable is still active, and pointing to the 7.36 source. Maybe that's the problem...? Going to fix now.... Last edited by quixote; 01-03-2011 at 02:31 PM. |
Tags |
pdf pdfwriter error |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AttributeError: 'NoneType' object has no attribute 'replace' when trying to add books | tilleydog | Calibre | 16 | 10-04-2010 04:29 AM |
AttributeError: 'NoneType' object has no attribute 'lower | manada | Calibre | 2 | 08-10-2010 10:54 PM |
Line' object has no attribute 'children | mazzeltjes | Calibre | 0 | 02-12-2010 09:30 AM |
'list' object has no attribute 'add_book' etc. | mazzeltjes | Calibre | 1 | 12-26-2008 01:12 PM |
'list' object has no attribute 'add_book' | drmathprog | Calibre | 2 | 11-13-2008 04:52 PM |