{"action":"created","issue":{"url":"https://api.github.com/repos/prawnpdf/prawn/issues/951","repository_url":"https://api.github.com/repos/prawnpdf/prawn","labels_url":"https://api.github.com/repos/prawnpdf/prawn/issues/951/labels{/name}","comments_url":"https://api.github.com/repos/prawnpdf/prawn/issues/951/comments","events_url":"https://api.github.com/repos/prawnpdf/prawn/issues/951/events","html_url":"https://github.com/prawnpdf/prawn/issues/951","id":138291197,"number":951,"title":"Dynamic repeater with fill_color -- causes missing text and an error in Acrobat Reader","user":{"login":"twobitfool","id":12453,"avatar_url":"https://avatars.githubusercontent.com/u/12453?v=3","gravatar_id":"","url":"https://api.github.com/users/twobitfool","html_url":"https://github.com/twobitfool","followers_url":"https://api.github.com/users/twobitfool/followers","following_url":"https://api.github.com/users/twobitfool/following{/other_user}","gists_url":"https://api.github.com/users/twobitfool/gists{/gist_id}","starred_url":"https://api.github.com/users/twobitfool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twobitfool/subscriptions","organizations_url":"https://api.github.com/users/twobitfool/orgs","repos_url":"https://api.github.com/users/twobitfool/repos","events_url":"https://api.github.com/users/twobitfool/events{/privacy}","received_events_url":"https://api.github.com/users/twobitfool/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-03T20:40:36Z","updated_at":"2016-03-29T22:31:15Z","closed_at":null,"body":"Problem\r\n-----------\r\n\r\nHere's the perfect storm:\r\n\r\n- more than \"a little\" text on the page\r\n- stamp with `dynamic: true`\r\n- `fill_color` set to `'000000'`\r\n\r\n\r\nSteps to Reproduce\r\n--------------------------\r\n\r\n1. Run the sample code (below)\r\n2. Open **error.pdf** in Acrobat Reader\r\n3. Scroll the 2nd page into view\r\n\r\n...and you'll get this error:\r\n\r\n> An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem.\r\n\r\nDismiss the error, and notice that the footer only shows up on the 1st page.\r\n\r\n\r\nRoot Cause\r\n----------------\r\n\r\nLooks like the `error.pdf` is missing a `/DeviceRGB cs`, but I'll leave that decision for the PDF experts.\r\n\r\n\r\n\r\nSample Code\r\n------------------\r\n\r\nThe following code generates a pdf with the error, plus variants to demonstrate the \"edges\" of the issue.\r\n\r\n```ruby\r\nrequire \"prawn\"\r\n\r\n\r\nLOREM = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"\r\n\r\ndef create_pdf(name, options={})\r\n  Prawn::Document.generate(name) do |pdf|\r\n    # Default options\r\n    line_count =  options[:line_count] || 12\r\n    page_count =  options[:page_count] || 2\r\n    dynamic    = !(options[:static]    || false)\r\n    fill_color =  options[:fill_color] || '000000'\r\n\r\n    pdf.fill_color fill_color unless fill_color.empty?\r\n\r\n    pdf.repeat(:all, :dynamic => dynamic) do\r\n      pdf.move_cursor_to 60\r\n      pdf.text \"FOOTER TEXT\"\r\n      pdf.text \"PAGE ##{pdf.page_number.to_s}\"\r\n    end\r\n    pdf.move_cursor_to pdf.bounds.top\r\n\r\n    line_count.times { |i| pdf.text(LOREM, size: 13) }\r\n\r\n    (page_count - 1).times do\r\n      pdf.start_new_page\r\n      line_count.times { |i| pdf.text(LOREM, size: 13) }\r\n    end\r\n  end\r\nend\r\n\r\n\r\n# Causes an error when the 2nd page is scrolled into view (Adobe Acrobat Reader)\r\ncreate_pdf('error.pdf')\r\n\r\n# No error here, but the footer ONLY shows on the 1st page\r\ncreate_pdf('fewer_lines.pdf',             page_count: 40, line_count: 10)\r\n\r\n# Footer shows up, but page number is wrong after 1st page (obviously)\r\ncreate_pdf('static_footer.pdf',           static: true)\r\n\r\n# Totally works, but text is now red ;)\r\ncreate_pdf('red.pdf',                     fill_color: 'AA0000')\r\n\r\n# Hacky work-around\r\ncreate_pdf('slightly_darker_black.pdf',   fill_color: '000001')\r\n\r\n# Or if just avoid setting the fill_color, that works too\r\ncreate_pdf('no_fill.pdf',                 fill_color: '')\r\n```\r\n\r\n\r\nSimilar / Related Issues\r\n--------------------------------\r\n\r\n- #925: Error in Acrobat Reader DC when using dynamic: true on repeater.\r\n- #473: Dynamic repeater can break colorspace\r\n- #200: Use of repeat stamp and fill_color results in blank document in Acrobat\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/prawnpdf/prawn/issues/comments/203139413","html_url":"https://github.com/prawnpdf/prawn/issues/951#issuecomment-203139413","issue_url":"https://api.github.com/repos/prawnpdf/prawn/issues/951","id":203139413,"user":{"login":"practicingruby","id":4893,"avatar_url":"https://avatars.githubusercontent.com/u/4893?v=3","gravatar_id":"","url":"https://api.github.com/users/practicingruby","html_url":"https://github.com/practicingruby","followers_url":"https://api.github.com/users/practicingruby/followers","following_url":"https://api.github.com/users/practicingruby/following{/other_user}","gists_url":"https://api.github.com/users/practicingruby/gists{/gist_id}","starred_url":"https://api.github.com/users/practicingruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/practicingruby/subscriptions","organizations_url":"https://api.github.com/users/practicingruby/orgs","repos_url":"https://api.github.com/users/practicingruby/repos","events_url":"https://api.github.com/users/practicingruby/events{/privacy}","received_events_url":"https://api.github.com/users/practicingruby/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T22:31:15Z","updated_at":"2016-03-29T22:31:15Z","body":"I'm pretty sure that #473 is related to this issue, in particular this comment:\r\nhttps://github.com/prawnpdf/prawn/issues/473#issuecomment-32369504"}}