Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed spine, other improvements #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cdce8p
Copy link

@cdce8p cdce8p commented Dec 29, 2017

  • Fixed support for spine
  • Fixed background-size for cover (error due to missing spine)
  • Bugfix: sometimes white border at top of page
  • Improved generated XSL-FO, also a speed improvement, due to rendering img as background-image
  • Added support for xml->bundlesize attribute to get coverWidth (which includes spineWidth)
  • Removed unused imports

Should also fix: #15

Note: the bundlesize attribute might not be backwarts compatible! I coun`t check that.

* Fixed support for spine
* Fixed background-size for cover (due to spine)
* Improved generated XSL-FO (speed improvement)
* Removed unused imports
@cdce8p cdce8p mentioned this pull request Dec 30, 2017
@albrechtf albrechtf self-requested a review December 30, 2017 20:27
@albrechtf
Copy link
Owner

Thanks for your contribution! Before I start a full review, might you please explain the basic concepts of your change? Especially why you changed units in many classes from millimeters to pixels, and why the renaming of setBundlesize to addBundlesize was necessary. Thanks!

@cdce8p
Copy link
Author

cdce8p commented Dec 31, 2017

My original intent was to fix the missing spine. I discovered that it's still possible to go your original route via spineWidth and normalPages if you get those parameter from the pricelist. Since this would have meant dealing with one more file I found an alternative in the bundlesize/width and bundlesize/height attributes. Regarding your question: I'm not quite sure why I choose addBundlesize instead of setBundlesize. In the next commit I will change that.

After that was done I noticed a slim white bar at the top of each page. My original idea was that at some point during the conversion the float values could be an issue. It turned out it wasn't the case. Neverthenless could working with ints instead of floast provide some benifits (see PageBackground) and since I already did most of the work their, I decided to follow through with it.

Regarding the withe bar at the top: While debugging I found a workaround. If you set bc.setAttribute("top", "-1px") the white bar disapears at the top, but sadly comes back at the bottom. Later I discovered that during the conversion an image is created which is subsequently placed in the block element. Since I know that the issue must be with the block-container element I tried the background-image parameter which worked. I still haven't figured out why it didn't work before though. This has the added benifit of reducing the overall size of the XML-FO. Out of curiosity I checked if other parameter aren't neccessary. It turned out that especially docBuilder.newPage() wasn't which reduces the overall size and speeds up the conversion quite a bit.

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

For big books the cover is cut on the right page
2 participants