Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:10:12+00:00 2026-05-25T14:10:12+00:00

I am developing some prawn reports and running into an issue where any line

  • 0

I am developing some prawn reports and running into an issue where any line I draw with a code like the following will render only in the last page.

horizontal_line(0, 200, :at => y)

It is called once per page.

My code is relatively complex now so I tried to isolate the problem to post here, the isolated code follows

require 'prawn'

a = Prawn::Document.new(:page_size => 'A4', :margin => [20,20,20,20])
a.font('Times-Roman')
a.horizontal_line(10, 400, :at => 140)
a.text_box('Test Text', :size => 50, :at => [2, 100], :width => 400)
puts a.render

For my surprise, it didn´t work even with a single page document. Only the “Test Text” is being rendered. It makes me think I am doing something wrong in the page setup or something like that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:10:12+00:00Added an answer on May 25, 2026 at 2:10 pm

    Fond out the problem.

    The correct use would be:

    require 'prawn'
    
    a = Prawn::Document.new(:page_size => 'A4', :margin => [20,20,20,20])
    a.font('Times-Roman')
    a.stroke do
      a.horizontal_line(10, 400, :at => 140)
    end
    a.text_box('Test Text', :size => 50, :at => [2, 100], :width => 400)
    puts a.render
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am developing some code in c# where i will be interacting with Microsoft
I'm developing some cross platform software targeting Mono under Visual Studio and would like
I am developing some program in C# which will send the mail using outlook
I'm developing some widgets into a library for internal use at the company I
I an developing some code in which I use a scanner to get to
I have been developing some Django app and there's some duplicated code for different
When testing and developing some scripts, I would like to be able to define
I am developing some reports in SSRS (SQL Server 2008 R2). I have given
I'm developing some code snippet, and I experienced that Visual Studio doesn't automatically add
I am developing some Python programs that I'm running on a remote Ubuntu Linux

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.