pdflib_wrapper 0.0.1.1 → 0.0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8f29701c2f544842334b4eca7ac7b6aa056a7bd
4
- data.tar.gz: 2df135da682e6d725a46c8d3cdc8d1ef2299448c
3
+ metadata.gz: 541a208987fa585a4a6077345ade38a9f100b291
4
+ data.tar.gz: c43d0aa51c7b5965ca05f150ca4141c669b6cc9f
5
5
  SHA512:
6
- metadata.gz: 3c9df8f7b7b1fd66278126097feedff40dd3592eed43a16218546cab145150d7e805edf2c45dffbeb7c07a12d6e235c03ed4520f809b1dc728089ec923a4cff3
7
- data.tar.gz: 9cf74bc9d4635dd63a9c62a10e059e163947f6551d59997fe61a754317eb7a26f86dae55e8f98360723753e45175063465ec475b269e3594ad740376a79adeec
6
+ metadata.gz: eb27406ed392d579be173fdb1d94a272899ece7f94ab502174c7d297dda6ce2ce993631e9943d5f0c31b1e48a3c5897d77ea7413878ff800e75cc13f35bca12d
7
+ data.tar.gz: 01794d1308b7ee3431ba0ce1205c80e1ab354e1b9c5977a64f0684c2f275d8354090d28559165c57f7879e2dab1eaa5a167bef8881d79a1c250c6c51467d8017
@@ -5,8 +5,10 @@ module PdflibWrapper
5
5
  attr_accessor :document
6
6
  def initialize(pdf, filepath, opts={})
7
7
  #TODO: support opts
8
+ key_values = [:password]
9
+ singles = []
8
10
  @pdf = pdf
9
- @document = @pdf.open_pdi_document( filepath, "" )
11
+ @document = @pdf.open_pdi_document( filepath, OptionListMapper.create_options('', key_values, singles, opts) )
10
12
  end
11
13
 
12
14
  def close
@@ -1,3 +1,3 @@
1
1
  module PdflibWrapper
2
- VERSION = '0.0.1.1'
2
+ VERSION = '0.0.1.2'
3
3
  end
@@ -81,4 +81,12 @@ describe PdflibWrapper do
81
81
  page = test_pdf.open_pdf_page(1)
82
82
  page.height.should be(height)
83
83
  end
84
+
85
+ it "opens password protected pdf" do
86
+ password_tempfile = Tempfile.new("external.pdf")
87
+ PdflibWrapper::Pdf.new(password_tempfile.path, {}, {with_blank_page: true, masterpassword: 'magic'}).save
88
+
89
+ pdf_handler = PdflibWrapper::Pdf.new('', {}, {dont_create_document: true})
90
+ pdf_handler.open_pdf(password_tempfile.path, {password: 'magic'})
91
+ end
84
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdflib_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.1
4
+ version: 0.0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Studener