Skip to content
shairontoledo edited this page Sep 13, 2010 · 2 revisions

Set passwords to allow user make actions with document


 doc.security do |sec|
   sec.owner_password ="testXXX"
   sec.user_password ="testYYY"
   sec.disable :print, :copy
 end

The code above, we are disabling print and content copy. Now disabling everything


doc.security do |sec|
sec.owner_password =“test123”
sec.user_password =“test567”
sec.disable :all
end

When open the document the password will be necessary

Disable options

  • :base or :print – Print document (possibly not at the highest quality level).
  • modify – Modify contents of document, except as controlled by :annotate, :interective and :assemble.
  • :copy – Copy text and graphics from document other than that controlled by :copy_access
  • :annotate – Add or modify text annotations, fill in interactive form fields, and if :interective is set, create or modify interactive form fields
  • :interactive – Fill in existing interacive form fields, even if :annotate is clear
  • :copy_access – Extract text and graphics (in support of accessibility to disabled users or for other purposes).
  • :assemble – Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even when :base is clear
  • :high_quality_print – Add or modify text annotations
  • :all – Disable all permissions.