I am having a new issue now where my cover issue prints twice, no matter what cover I use or what what book I try to print. This is when I try to make a screen pdf. Is there a simple setting that I may be missing? I can include a sample of the PDF if people need to see what it looks like.
Unless you have the cover image also in Chapter 1, it sounds like there is some duplication in your screen PDF converter script or CSS. Have you made any modifications there? Are you using the Academic theme or custom styles?
The PDF does not tell us much by itself, but if you take the URL of the PDF output and replace the last part (after the slash) with body.html you can obtain the document source as sent to the screen PDF converter.
Fixed this one a bit ago, but wanted to circle back to close the loop. I had customized the css and need to change how the background image was displayed on some of the css.
Thank you for the help! I learned a lot digging around.
Quinn says he had customized some css, which then may have created the problem on his installation.
I have not touched any file anywhere and not made any modification, just using default install. So the problem must be some default setting in the automated install settings. What to do??
I tracked down this covers bug in Booktype 2.0, it has to do with the templates and CSS in the themes such as 'Academic' and 'Custom'. I fixed it while refactoring these themes to make them simpler and easier to work with, starting with the commit:
So if you have installed from the git repository, you can get these fixes by doing a git pull. If you have the automated install, from the .deb package, you can either wait for the 2.1 release, or, more likely, copy the files you need from the git repository to your installation.
In Booktype 2.0 you'll find these files in the source directory lib/booktype/apps/themes/templates/ and in lib/booktype/skeleton/themes/
In current git and for the 2.1 release we're consolidating them under the single path of lib/booktype/skeleton/themes/ to make things easier.
During creation of Booktype instances, theme files get copied from the source directory to the individual instance, for example /var/www/booktype/instance1/themes/ so that they can be customised.
If you're installing theme updates manually, and you only have a small number of instances, you might want to skip copying them to the source directory and just copy them directly into the instances you need.
I dont' know git very well, so not sure how I can download those fixes. I installed using deb automated install, so I can not do a git pull. Do I have to download each file manually, or is there some other way to download all relevant files?
https://github.com/sourcefabric/Booktype/archive/2.0.zip will get you the current state of the 2.0 branch in the git repo. After unzipping please take a look in Booktype-2.0/lib/booktype/skeleton/themes/ and you will find the files you need there.
The most pertinent files are screenpdf.css and the templates. See also theme_fonts.php which contains a font configuration snippet for mPDF.
Then I browsed into the /var/www/booktype/instance1/themes/ folder and use WGET to download each of the 16 files into their respective folders as outlined by the path displayed on top of each file in github
First I backed up each original file in every directory under /themes/
I then finished up with: chown -R www-data:www-data /var/www/booktype/
All that has happened, as I can see, is that when I now try to export a screenpdf, the exported file download button is greyed out. It export the file, but it is not possible to download it.
If the download button is greyed out, that means export has failed, which is why the download file is not available. First I would suggest you restart supervisord to force restart of the celery workers:
sudo service supervisor stop sudo service supervisor start
If that does not help, take a look in /var/www/booktype/instance1/logs/ for any files with a time stamp of today. Then view the end of the log file with (for example):
less +G /var/www/booktype/instance1/logs/booktype-celery.error.log
Still same error with the greyed out download button.
I have probably messed up totally, can I revert back by running: apt-get install booktype ?
Otherwise I may have to revert back to an older droplet snapshot. No problem, I can do that. Actually I will do that and start all over, to make sure I copy your fixes correctly.
If you have no log output from celery it could be because you are using the production profile. Consider using the development profile if you want to modify files, it will be much easier.
Daniel, I used the automated install, so there was no option (as far as I remember) to choose what profile to use, production or developement. And I am working on a live site, so I assume this is production profile, and don't know how to change that.
I had most probably placed the *.html files in the wrong directory.
And, finally, in your fix there is some files placed in the /academic/static dir, should I do the same, put those (your related github fix files) in the /academic/static dir?
And the same question goes for all the other files in the above fix, files which reside as "duplicates" in various directories in the structure.
Could you please tell exactly where to place each file from the fix? I know it is a bit of work for you, but this folder structure is so relatively complicated, that if I must use the trial and error method I will probably never get it correct. Apology for my frustration, but thats how I feel it. Any help? :-)
Each theme has HTML template files for the frontmatter, body and endmatter of the different output formats available. These are not really duplicates, as they can differ according to the theme.
In the first level of the lib/booktype/apps/themes/templates/themes/ directory you will find some default .html templates which are used if there are no themes available. Beneath this directory you can see the custom/ directory which contains templates so that users can choose their own design in the editor.
In Booktype 2.0 the themes such as academic/ were also beneath lib/booktype/apps/themes/templates/themes/ but in recent git (for Booktype 2.1) they have moved to /lib/booktype/skeleton/themes to be separate from the code. The 'skeleton' is the stuff that gets copied to a new unique instance when that instance is created, so that each instance can have its own themes.
Then my understanding of what you are saying, is that I shall replace the HTML files in /var/lib/booktype/lib/booktype/apps/themes/templates/themes/academic/ with the HTML files from you fix? Is this correct?
And then, inside the /var/lib/booktype/lib/booktype/apps/themes/templates/themes/academic/ there is a /static/ directory, where I shall put these files:
The file format is the same and should be compatible, but you may experience some breakage if you mix template and CSS files from different versions of Booktype.
If you want to modify files like this, I'd suggest that you switch to using git for installation, as this will help you keep track of all the changes. It will also enable you to start from the latest versions of these files.