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

Fixes #259 - Sidebars now render on multiple pages #735

Closed
wants to merge 1 commit into from
Closed

Fixes #259 - Sidebars now render on multiple pages #735

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 17, 2017

Refactored convert_sidebar to mirror behaviour of convert_quote_or_verse, such that multiple pages draw correctly. Requires drawing the block content twice, and there's a small hack, but it works.

I coded this just to get something working, but happy to accept edits - I am using as-is at the moment and seems to work as expected.

Fixes #259

…rse, such that multiple pages draw correctly. Requires drawing the block content twice, and there's a small hack, but it works.
@ghost
Copy link
Author

ghost commented Feb 24, 2017

Closing this - looks like it causes NaNs in the output PDF, which Chrome PDF viewer wasn't catching. A proper fix is going to need some more looking at... once/if I figure out how in the heck to make this work, I'll open a new pull request.

@ghost ghost closed this Feb 24, 2017
@ghost ghost deleted the 259_multi_page_sidebars branch February 24, 2017 12:24
@mojavelinux
Copy link
Member

Great! I still plan to review your code to see if I can provide some guidance. I apologize for letting this linger. I've been behind on reviews lately.

@ghost
Copy link
Author

ghost commented Feb 26, 2017

Awesome thanks - no problem with the lingering. FYI if you take out the "HACK" in this code, which only sort of worked anyway, the specific symptom is as follows for a sidebar that spans three pages (the most interesting case):

  • First draw of content renders correctly.
  • Draw of the box skips the second page, and draws the second and third page boxes on the third page
  • Second draw of content also skips over second page, draws second and third page of content on the third page

The whole thing of moving the second draw down an extra page has me scratching my head; I can only assume that there's some lingering state set in the PDF by the first content draw, but I can't figure out what it is. It's not impossible that this is triggered by earlier non-spanning sidebars as well. I'm still trying to work down to a minimal repro, but I'm at a conference this week so won't make progress for a little while.

@ghost
Copy link
Author

ghost commented Mar 20, 2017

@mojavelinux New fix which doesn't break everything is in #780. Something was getting modified in the graphics state that messed things up for subsequent drawing - saving and restoring graphics state made it work.

@ghost
Copy link
Author

ghost commented Mar 21, 2017

@mojavelinux Ignore that last one, I got overexcited apparently. #781 actually fixes things.

This pull request was closed.
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.

1 participant