简体   繁体   中英

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 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,

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM