prawn | Fast , Nimble PDF Writer for Ruby | Document Editor library

 by   prawnpdf Ruby Version: 2.3.0 License: Non-SPDX

kandi X-RAY | prawn Summary

kandi X-RAY | prawn Summary

prawn is a Ruby library typically used in Editor, Document Editor applications. prawn has no vulnerabilities and it has medium support. However prawn has 6 bugs and it has a Non-SPDX License. You can download it from GitHub.

Prawn is a pure Ruby PDF generation library that provides a lot of great functionality while trying to remain simple and reasonably performant. Here are some of the important features we provide:.

            kandi-support Support

              prawn has a medium active ecosystem.
              It has 4464 star(s) with 679 fork(s). There are 94 watchers for this library.
              It had no major release in the last 12 months.
              There are 95 open issues and 756 have been closed. On average issues are closed in 567 days. There are 24 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of prawn is 2.3.0

            kandi-Quality Quality

              prawn has 6 bugs (0 blocker, 0 critical, 5 major, 1 minor) and 109 code smells.

            kandi-Security Security

              prawn has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              prawn code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              prawn has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              prawn releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              prawn saves you 7690 person hours of effort in developing the same functionality from scratch.
              It has 15856 lines of code, 614 functions and 196 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed prawn and discovered the below as its top functions. This is intended to give you an instant insight into prawn implemented functionality, and help decide if they suit your requirements.
            • Creates a new mask
            • Draw axis .
            • Start the page .
            • Generate an object from a PDF file
            • draw number of pages
            • Create a span .
            Get all kandi verified functions for this library.

            prawn Key Features

            No Key Features are available at this moment for prawn.

            prawn Examples and Code Snippets

            No Code Snippets are available at this moment for prawn.

            Community Discussions


            Trying to make a two column unordered, bulleted list with Prawn PDF in ruby/rails?
            Asked 2021-Jun-11 at 21:38

            I am having trouble with how to create a two-column bulleted list using prawn PDF and prawn/table. I wanted to know if there is a way to do it that's not too custom/uses existing classes to take care of overflow to a new page, etc so I don't miss things or reinvent the wheel.

            I want the list to look something like this:

            *Name 1 * Name 3

            *Name 2 * Name 4

            ... ...

            Currently what I have is:



            Answered 2021-Jun-11 at 21:38

            Alright so I ended up using the table method, I'm not sure why I didn't think of this earlier but we can just split the list of names in half and append them in such a way that the second half of names is appended to the same row as the first half of names. Here is essentially what I did:



            = javascript_include_tag "application" giving error ExecJS::RuntimeError at / SyntaxError: [stdin]:1:1: unexpected //=
            Asked 2021-May-04 at 18:59

            I am more of a Java programmer and still somewhat new to development (2 years or so, can write Java code & web apps just fine) however the company I work for has 4 Rails applications and was asked to get this application working called CtrlPanel. I have been having to learn Ruby on Rails in order to help get this issue with this app fixed and get it working.

            I have been working on this problem for over a week all day long every day and nothing I do is fixing it.

            I fixed everything to the point the app comes up, web server runs serves the pages but all views are white screens as long as this application.html.haml file is present. I re-wrote the file with very basic bootstrap and it sort of works but nothing looks right. The problem seems to stem from 1 single like that simply says: = javascript_include_tag "application"

            I have been all over the internet and have tried every single fix from changing coffee-script-source to v1.8.0 as I read Windows has an issue with newer rails and that file, I have tried every variation of changing it from application to default, and every type of ending you can think of no matter what I do it gives me this error message which I can not seem to find.

            I am not even sure WHAT that line does, I assume it has to do with the new Google Maps API and I verified the key is valid and it was working before.

            This is the error is it giving it says the line with "= javascript_include_tag" "application" giving error ExecJS::RuntimeError at / SyntaxError: [stdin]:1:1: unexpected //=

            I am running a PC on Windows 10 20H2 x64 UEFI ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32] Rails 6.1.3

            (I did also install Ubuntu on another machine and it gives the exact same error, also gives the same error on another Windows machine)

            The app is working IF I delete the "application.html.haml" file and put in a skeleton basic version all of the other views start working but of course none of them look right no menus no bootstrap no nothing.
            Here is the application.html.haml file.



            Answered 2021-May-04 at 18:59

            I did finally figure out what this was.
            The older versions of rails in this case v4.2.1 used the javascript_include_tag for the line that deals with application:

            = javascript_include_tag "application"

            In the newer versions of rails in my case v6.1.3.1 you have to use javascript_pack_tag

            = javascript_pack_tag

            This solved the issue and the views all started working. I did mention above I was working on a PC running Rails v6.1.3; however I noticed I didn't make it clear that I was also having to upgrade this program from Ruby v2.2.2 and Rails v4.2.1 to Ruby v 2.7.2 and Rails v6.1.3, that might have helped to have made that more clear. Apologies if that confused anyone. I am still VERY new to Rails and using I am happy to report I have only 1 single issue left on this program and the rest of the program is all working properly. I will be posting another question in fact because the last issue deals with a complicated scope query and it uses different syntax again due to the newer version of rails and I haven't been able to figure it out. In any even if you are running an older version of Rails and you are trying to get the program to work on a newer version (my case as I couldn't get rails v4.2 to run or work on ANYTHING, PC, Linux nothing) then you have to change the include_tag to a pack_tag. I do not pretend to say I fully understand why. I know it has to do with webpacker but beyond that I am still learning Rails. Perhaps someone with more knowledge than myself can shed some insite as to why the syntax changed. Oh and in addition the line ended up needing to read as follows:

            = javascript_pack_tag "application", "data-turbolinks-track": "reload"

            I didn't have the turbolinks reference either.

            I hope this helps someone else in a similar situation that I was in, it was not easy to find. I only discovered it when I went through some tutorials on making other generic apps and saw the difference on that line.



            How to do update dropdown & how to make selected value for validation purpose in laravel?
            Asked 2021-Apr-24 at 07:53

            In my view method, my selected dropdown like this. My problem are:-

            1. How do I retrieve data from a database if I'm using the dropdown field? (Update Method)

            2. How do I want to make the dropdown selected? (Validation & Show Method)



            Answered 2021-Apr-24 at 07:17

            I get it correct this ways:-



            Rails merge string to existing one when if true
            Asked 2021-Feb-04 at 09:00

            I'm using gem prawn for PDF generation. I want to create table using that gem to do so I'm gonna use make_cell from that gem, as follow:



            Answered 2021-Feb-04 at 08:58


            Rails sort association with scope mixed ordering
            Asked 2021-Jan-27 at 08:17

            In CashTransaction model I've got default scope:



            Answered 2021-Jan-27 at 08:17

            default_scope is probably one of the worst part of Rails and should be avoided at all costs.*

            You can just create a custom scope if you have some special ordering you do often.



            Rails replace if/elseif block by guard
            Asked 2021-Jan-21 at 12:04

            I create a table of cash transactions inside of PDF using Prawn gem. To do so I iterate through the Hash with parsed_cash_transactions but before each is started I need to save the last_item of that Hash to check when I should display the summary table below the main table.



            Answered 2021-Jan-21 at 12:04

            You could indeed use a guard clause, although it is not the most pretty, since it condition is pretty long.



            cannot load such file -- rails/commands (LoadError)
            Asked 2020-Dec-23 at 19:39

            I am trying to setup a project that uses rails 2.3.2. In my Gemfile I have gem "rails", "2.3.2". Running bundle install outputs Using rails 2.3.2. When I try to run any rails commands, in this case rails s I get a load error.



            Answered 2020-Dec-23 at 19:34

            In Rails 2.3.x the command to start the server is



            How to put an image on a label using Prawn/labels?
            Asked 2020-Dec-09 at 04:24

            I'm using Ruby for scripting, and Prawn-labels to print ISBN labels for books, using Barby to generate the EAN-13 bar codes.

            The ISBNs come out of MySQL. That works fine. I can create a PDF of 30-up labels containing the titles of the books, using Prawn/labels. That works fine.

            However, I am not having much joy putting a Barby-generated PNG image of the proper EAN-13 barcode on the label.

            Here's getting the info out of the database and generating EAN-13, pretty straightforward:



            Answered 2020-Dec-08 at 23:46

            Use pdf.image(png) instead of pdf.embed_image. This is a wrapper around pdf.embed_image that does the necessary work of getting the necessary data out of the PNG file.



            Prawn the horizontal line from the left border/edge in PDF
            Asked 2020-Nov-19 at 21:50

            I use gem prawn to generate pdf file. I want to have horizontal line 105 mm from top, 1pt line, #000. I've set left margin and top margin (I need it in the rest of the pdf) as follow:



            Answered 2020-Nov-19 at 21:50

            You need to use the #canvas method to temporarily reset the bounding box to the full page:



            Rails gem prawn - undefined method `[]' for Float in horizontal line with a specific location
            Asked 2020-Nov-17 at 10:11

            I'm using Prawn gem to generate the PDF file (A4 format). I want to have two horizontal lines/folding marks which should be available: 105 mm from top of the document, 1pt line, #000. From what I know I could call something like:



            Answered 2020-Nov-17 at 10:11

            I believe stroke_horizontal_line expects the third argument to be a hash. You need to include the key before the data.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install prawn

            You can download it from GitHub.
            On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer for more information.


            Because Prawn is pure Ruby and all of its runtime dependencies are maintained by us, it should work pretty much anywhere. We officially support all Ruby versions suported by Ruby Core Team and JRuby versions of matching Ruby version. However we will accept patches to fix problems on other Ruby platforms if they aren't too invasive.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone prawnpdf/prawn

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link