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 there a specific method in the document that allows me to create text which later can be modified in a pdf software? (similar to when you use markup tools in for exmaple Bluebeam)

This is the method that I am currently using to generate a text in a pdf document:

        require "prawn"

        Prawn::Document.generate(
          filename,
          # margin: 1/4" which is going to be 18 pts.
          margin: 0,
          page_size: page_size_str,
          page_layout: :landscape,
        ) do

        start_new_page(size: page_size, layout: :landscape)

        text_box "Sample text that later can be edited in Bluebeam or Adobe Acrobot with a single click", at: [80, 100]

        end


If this is not possible with Prawn, is there any pdf writer library in Ruby that allows printing editable text?

Thank you,

1

There are 1 best solutions below

0
gettalong On

You can do this in Prawn but you maybe have to build the necessary annotation objects yourself, depending on what kind of annotation you want.

As @Stefan pointed out, some annotations can be easily generated:

require 'prawn'

Prawn::Document.generate('file.pdf') do |pdf|
  pdf.text_annotation([100, 100, 200, 200], "Some text here")
end