Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
11 views

Prawn Gem - Print the textbox section dynamically after a table

I use prawn gem to generate a pdf file with tables and other sections. The text_box position are static and it is working as expected. Now I want the text_box below the table to be dynamic. Below is ...
siva's user avatar
  • 1,471
0 votes
0 answers
48 views

How to render html tags correctly in PDF using gem "prawn"

I'm generating PDF report in my Rails app and uses gem "prawn" but having trouble handling the descriptions data because it contains html tags e.g. < b >, < ul >, < li >, &...
aldrien.h's user avatar
  • 3,615
0 votes
0 answers
40 views

prawn/prawnto/prawnto_2 - external image not opening even with require 'open-uri'

I inherited an out of date rails site that I've been updating. One of the changes I need to make is to load some external images in a PDF using prawn instead of a local file. I've added the require '...
Dustin's user avatar
  • 1
0 votes
0 answers
21 views

How to control the size of an ActiveStorage embed in Prawn?

I use Prawn to export ActionText (Trim) to PDF. This is straight forward. However, ActionText embeds (images) are posing a challenge. Because ActionText includes html, I am using prawn-markup to ...
hellion's user avatar
  • 4,790
1 vote
1 answer
82 views

Dynamic Header with prawn gem

I'm encountering an issue while rendering a header with the report_date argument passed into the render_header method. Despite passing a different report_date value each time, the PDF always displays ...
Samala Sumanth's user avatar
0 votes
1 answer
100 views

Prawn PDF Encryption Bit Increase

I used Prawn to generate PDF's in Rails and I noted that in the documentation from line 76 that: The encryption used is weak; the key is password-derived and islimited to 40 bits, due to US export ...
doer123456789's user avatar
1 vote
1 answer
83 views

Table in pdf, generated from Asciidoctor have word wrapping but the word becomes unsearchable

I have the following table in Adoc which is generated by swagger annotation of java APIs. [options="header", cols=".^5a,.^5a,.^5a"] |=== |Name|Description|Schema |**...
Vanshaj Behl's user avatar
0 votes
1 answer
139 views

How to Add a Resized Image to an Existing PDF Using Ruby on Rails?

I'm working on a Ruby on Rails project, and my goal is to add a resized image, specifically a signature, to an existing PDF. I want to emphasize that I'm looking to add a simple image, not a complex ...
mrcode's user avatar
  • 29
0 votes
0 answers
28 views

Rails / Prawn Image From Active Storage Color modified

I'm looking for your help regarding an issue i have with on Rails with Prawn(Gem for PDF) when adding an image from Active Storage. When using the image on the app there is no issue but when i add the ...
Maximilien Hawawini's user avatar
0 votes
1 answer
58 views

Difficulty transferring prawn pdf image to frontend

I am streaming a prawn PDF to the frontend of my application, but it shows the image as 100% black. The image is a gif file that I convert to png using rmagick. If I save the pdf file on the backend,...
Julie's user avatar
  • 1,991
0 votes
1 answer
299 views

Insert QR code into PDF using gem receipts in Ruby on Rails

I'm using gem 'receipts' by Chris Oliver, and I want to insert QRcode with payment details (to the footer section for example). Models: Partner and Charge. I want QR code to contain model attributes, ...
Alexander V's user avatar
1 vote
0 answers
161 views

Ruby on Rails - How to convert to images some elements from a word document

Context In our platform we allow users to upload word documents, those documents are stored in google drive and then dowloaded again to our platform in HTML format to create a section where the users ...
altose87's user avatar
0 votes
0 answers
189 views

Rails PDF generation in model

I am writing and invoicing application in Ruby On Rails, which is supposed to generate a PDF from a model so called out_invoice to an in_invoice under certain conditions. The PDF for the out_invoice ...
Julian's user avatar
  • 27
0 votes
1 answer
301 views

Prawn Html text and image not same line

I am using prawn and prawn html, when I using PrawnHtml.append_html(pdf, '<p style="display:inline;"><img height="26" width="26" src="path_image" >...
Devi Firdaus's user avatar
0 votes
1 answer
154 views

Validate PDF is stampable - Rails, Prawn, CombinePDF

I'm working at a company where we upload a good amount of PDFs, which we later stamp using Prawn. Occasionally these PDFs upload and save fine, but when we try to stamp them later they don't work and ...
SomeSchmo's user avatar
  • 665
0 votes
1 answer
118 views

Is there a way to generate a pdf file with editable text (comments or markups) using Prawn libaray in Ruby that can be modified later?

I have been using Prawnpdf in Ruby to generate pdf documents. The only issue that I have is that I cannot modify the rendered text in the pdf file afterwards (using Bluebeam or Adobe Acrobot Pro). Is ...
Mahmoud H's user avatar
1 vote
1 answer
259 views

#<NoMethodError: undefined method `table' for #<PdfMethods:0x0000023fc7b70648>>

I have been trying to create a table in a pdf i am generating using Prawn gem in rails. I have been following some tutorial but when I try adding the table to the pdf I am getting the error '#<...
Elvis Githinji's user avatar
1 vote
0 answers
158 views

Prawn: is there any way for text justify alignment of all content in bounding_box?

I have an arbitrary text write for user customer_note and I'd like to align the text randomly in a text align justify, I have tried to access the text but there is no way to justify the text. if ...
Samuel D.'s user avatar
  • 189
0 votes
0 answers
49 views

(nil can't be coerced into Integer) getting this error when using prawn gem

@@pdf = Prawn::Document.new summary='s2_summary' @@pdf.text summary.to_s, :align => :left @@pdf.text "Dsh Days Breakdown", :align => :center when running the code " @@pdf.text ...
Asw's user avatar
  • 1
0 votes
1 answer
2k views

Convert html to pdf using prawn in ruby on rails

I am working on a Rails project and I need to convert the HTML page to a PDF page but it's writing HTML as it is on a pdf page. PDF page is not showing like a webpage. How can I generate a proper PDF ...
Varinder Sohal's user avatar
0 votes
0 answers
277 views

PDF Prawn: opening a link in a new tab

I'm trying to open the following link, that is created in a PDF (which is automatically opened in a browser), in a separate tab - I am using Prawn PDF. pdf.formatted_text_box [{ text: t('link'), ...
nkhape's user avatar
  • 1
2 votes
0 answers
388 views

How to display application/pdf response from Rails API to Nuxt frontend

I'm using Nuxt and Rails to generate PDF. Chose prawn gem for PDF, and when send proper params, PDF was generates as I intended. When I use this API from Nuxt throw axios, I want to display ...
batch's user avatar
  • 145
0 votes
1 answer
121 views

I cant draw and format prawn text properly

Can you help me?? I need to draw one line text in prawn pdf with responsible text size which depends on text characters count... Less chacters count -> bigger text size. bounding_box([...
Igor Romanchuk's user avatar
0 votes
1 answer
323 views

Trying to make a two column unordered, bulleted list with Prawn PDF in ruby/rails?

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 ...
INVALID_FIELD's user avatar
1 vote
0 answers
227 views

Error installing prawn-gmagick within Heroku stack 20 due to invalid wand/magick_wand.h path

Here is the error I'm getting when trying to deploy to Heroku using the most recent stack (20) Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/...
Heriberto Magaña's user avatar
1 vote
1 answer
1k views

rails 6.1: cannot load such file -- prawn-table

I am using the prawn gem to create pdf's. So, to create tables requires using the separate prawn-table gem. For some reason, I am unable to require the prawn table gem and have no clues as to why. The ...
willyab's user avatar
  • 303
1 vote
1 answer
278 views

Hexapdf: trying to draw white box, but its not appearing

When I run my code, my white box does not appear. I need a white box to cover existing images, text, so I can add new text. If I change the color to background_color: [255,255,180], the box is a ...
Lefty's user avatar
  • 655
1 vote
1 answer
1k views

How to use CombinePDF with Rails 6 (ActiveStorage) on heroku

I generate PDF documents using Prawn in Rails. For years I have only inserted jpg's into PDFs. More recently I've had a need to insert an external PDF into a Prawn PDF. The way to do this seems to ...
hellion's user avatar
  • 4,790
0 votes
1 answer
171 views

Can't See Info (Metadata) in Prawn Generated PDF's

I am using the prawn Ruby gem to generate PDF files in my application. I would like to insert some metadata in the PDF and have done as specified in the docs: private def prawn_create_document(...
Keith Bennett's user avatar
2 votes
0 answers
561 views

Bad image quality with CarrierWave

I want to create the ability for the user to upload an image into a pdf which will be generated inside of the app. To do so I'm using gem prawn to pdf creation and CarrierWave::MiniMagic to create ...
mr_muscle's user avatar
  • 2,870
0 votes
2 answers
224 views

How to put an image on a label using Prawn/labels?

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 ...
Jan Steinman's user avatar
0 votes
1 answer
18 views

Build content block in Prawn?

This seems to be easy but I can't find a solution. I have a table like this: table([["cell 1","cell 2","cell 3" ]] I want to do something like this: content = block do ...
Dan Tappin's user avatar
  • 2,962
0 votes
1 answer
341 views

Prawn the horizontal line from the left border/edge in PDF

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: LEFT_MARGIN = 25....
mr_muscle's user avatar
  • 2,870
0 votes
1 answer
129 views

Rails gem prawn - undefined method `[]' for Float in horizontal line with a specific location

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 ...
mr_muscle's user avatar
  • 2,870
1 vote
2 answers
688 views

Adding image to PDF in Prawn using image data

So I have an image that's being saved in a database that I need to show on my Prawn Pdf, but when I pull the image, decode it, and try to display it on the Prawn PDF, I keep getting the issue where it ...
MyNameIsntBob's user avatar
1 vote
1 answer
815 views

Prawn PDF change font size and line height from html_text

In my Rails 6 app with Ruby 2.7 I'm using gem prawn to generate a pdf file. So far everything has been rather straight forward. I'm having a problem defining line height in html_text. Like in a method ...
mr_muscle's user avatar
  • 2,870
2 votes
1 answer
610 views

Insert rounded rectangle into a Prawn table cell ruby

I am trying to recreate this in Prawn but could not get the rounded rectangles inside the table cell. I have used Prawn table and here is my code - tabledata = [["City", "Count" ],...
user435215's user avatar
-1 votes
1 answer
920 views

Prawn set cell color under a condition while making a table

I'm trying to generate a table while changing the background color of a cell under a condition. I've resorted coming to here for help. Here's an example of what I'm trying to do: idx = 0 ...
Jack Shack 's user avatar
1 vote
1 answer
1k views

How to compress a pdf uploaded by a user in rails using Prawn Gem [closed]

I am new in rails and also in programming. I am trying to compress pdf using Prawn gem but I am not sure if it's the right gem to use or is there is another tool. A user is able to upload a pdf, but ...
Morgana Borges's user avatar
0 votes
1 answer
553 views

How to encrypt csv/xlsx file in Rails

I am want to implement password protection to my csv/xlsx file, but somehow not able to. I am not able to find something written well over the internet. I tried this with xlsx. render formats: :xlsx ...
Salman Haseeb Sheikh's user avatar
0 votes
2 answers
416 views

I'm creating a PDF in Prawn and I'm trying to use :absolute_top_left and :absolute_top_right but they both send it to the top left

This is what I have so far Prawn::Document.generate(location) do |pdf| pdf.text location1, :absolute_top_left => true pdf.text location2, :absolute_top_left => true pdf.text location3,...
Jerramy Kingston's user avatar
0 votes
1 answer
174 views

How to get rid of weird box characters in PDFs generated with Prawn?

I am running a Rails 6 app where users can convert their contents into PDFs. I am using Prawn to generate the PDFs. Most PDFs look fine but some of them contain empty (?) box characters. I simply don'...
Tintin81's user avatar
  • 10.2k
2 votes
1 answer
955 views

Prawn PDF: change Prawn::Document object's margin

The first page of my PDF is a full width/height image, so I've set margin: 0 while generating my Document Prawn::Document.generate(FILENAME, margin: 0) do |pdf| ... end Though I'd like the rest of ...
Sumak's user avatar
  • 1,021
0 votes
1 answer
124 views

Is there an upgrade gem to prawn to covert odf (.odt)?

I've been using the awesome prawn gem in my last few project, but this time I have to covert a odt file (in odf format) to PDF. I know that there are many gems that can do this, for example docsplit ...
Anonymus's user avatar
  • 333
-1 votes
1 answer
1k views

Fill PDF form with data and images

My goal is to fill the existing PDF interactive form with user data. Requirements for this are: it should be able to insert data into text fields; it should be able to insert an image on the XY ...
user avatar
0 votes
0 answers
257 views

How to give padding to child table in Prawn PDF?

I have generated a nested table using Prawn but it occupies the whole space of the parent table so it is becoming difficult for users to identify which is a child. Is there any way where we can give ...
Sanjay Prajapati's user avatar
0 votes
2 answers
1k views

Create pdf file from multiple models in rails app

In my rails app the user inputs a lot of data in different models. The user should have the possibility to create a pdf file from all the data he inputted in the different models. Which ruby gem does ...
Jul's user avatar
  • 141
0 votes
0 answers
193 views

Rails Prawn randomly generates corrupt PDF files

I'm having an issue with the Rails prawn gem. It happens very rarely and seems to be completely random. When it does happen, the PDF that is generated has all garbled text. There's no error message or ...
Tony M's user avatar
  • 341
1 vote
1 answer
408 views

write text combine two language Arabic and English in prawn rails

i need write text combine two language for example use require 'arabic-letter-connector' text_direction :rtl # ltr long_text = " Algorithm & Data Structure مرحبا يا العالم" text ...
user avatar
0 votes
1 answer
314 views

Using link_annotation with :Desc option in Prawn PDF

I have been struggling to link a text heading with a specific page in the Pdf, similar to the linking of Table of Contents in the Pdf file. I have found link_annotation method to achieve this however ...
Aamir's user avatar
  • 16.9k

1
2 3 4 5
15