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

start_new_page uses the same grid layout as first page - override is not working #1108

Open
sthennarasan opened this issue Apr 2, 2019 · 0 comments

Comments

@sthennarasan
Copy link

Basically, I am trying to create a pdf with different contents on first page and different content on page 2, but start_new_page always gives the grid system that was created for first page.

    def initialize()
      document_setup
    end

    def render
      show_grid
      header_left
      header_right
      content
      footer
      start_new_page
      show_grid
      page2_setup
      page2_header_left
      page2_header_right
      page2_content
      page2_footer
      self
    end

    def document_setup
      define_grid(columns: 4, rows: 32, gutter: 8)
      @grid_header_left = grid([0, 0], [10, 1])
      @grid_header_right = grid([0, 2], [10, 3])
      @grid_content = grid([11, 0], [28, 3])
      @grid_footer = grid([29, 0], [31, 3])
      document.font 'Helvetica', size: 10, line_height: 16
      document.default_leading 5
    end

    def page2_setup
      define_grid(columns: 4, rows: 32, gutter: 8)
      @p2_grid_header_left = grid([0, 0], [5, 1])
      @p2_grid_header_right = grid([0, 2], [5, 3])
      @p2_grid_content = grid([6, 0], [20, 3])
      @p2_grid_footer = grid([21, 0], [31, 3])
      document.font 'Helvetica', size: 10, line_height: 16
      document.default_leading 5
    end

Why is page2_setup not overriding the first page grid layout?

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

No branches or pull requests

1 participant