acrobat 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.standard.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/Guardfile +28 -30
- data/{LICENSE.adoc → LICENSE.txt} +3 -4
- data/README.md +107 -0
- data/Rakefile +6 -54
- data/examples/6030.17.antenna.pdf +0 -0
- data/examples/6030.17.cm300.tx.pdf +0 -0
- data/examples/form_field.rb +21 -0
- data/examples/merge.rb +11 -0
- data/lib/acrobat/app.rb +172 -187
- data/lib/acrobat/jso.rb +87 -94
- data/lib/acrobat/pdoc.rb +134 -137
- data/lib/acrobat/version.rb +5 -0
- data/lib/acrobat.rb +45 -48
- data/samples_other/background.js +40 -0
- data/samples_other/find_word.vb +440 -0
- data/samples_other/form.vb +393 -0
- data/vba/overlay.vba +40 -0
- metadata +27 -190
- data/.gitignore +0 -32
- data/History.adoc +0 -6
- data/Manifest.txt +0 -14
- data/README.adoc +0 -117
- data/bin/acrobat +0 -3
- data/test/acrobat_test.rb +0 -36
- data/test/test_helper.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0dbaa90ebab7df2e5eeb70d4bfff5a75448134d3efa100a45fe172080b85df8
|
4
|
+
data.tar.gz: f9b04d87101a45da0fdc675ea98a54c2eb73abd723e10844078d7d0474799947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b306b051e57f3a9224d3cdb9b7f57df2b07d99533eac4d9dcf4d6bf59836d78a93dcafac356e8ea15ab76c9fe7fb847e67ff245d76239337e85b4224675571b7
|
7
|
+
data.tar.gz: 9811e4ca8066d17b88b3e010a162ade3b10cae13e3c322e3c9db7705702e9d7b5c324b5e6d45146c9531620d586ed2506e0a723d589a47e447e679c22731d40c
|
data/.standard.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
10
|
+
identity and orientation.
|
11
|
+
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
14
|
+
|
15
|
+
## Our Standards
|
16
|
+
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
26
|
+
community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
31
|
+
any kind
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
* Public or private harassment
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
35
|
+
without their explicit permission
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official email address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
[INSERT CONTACT METHOD].
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
86
|
+
actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
93
|
+
ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
+
community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.1, available at
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
123
|
+
|
124
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
127
|
+
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|
data/Guardfile
CHANGED
@@ -1,30 +1,28 @@
|
|
1
|
-
# A sample Guardfile
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
3
|
-
|
4
|
-
## Uncomment and set this to only include directories you want to watch
|
5
|
-
# directories %w(app lib config test spec features) \
|
6
|
-
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
-
|
8
|
-
## Note: if you are using the `directories` clause above and you are not
|
9
|
-
## watching the project directory ('.'), then you will want to move
|
10
|
-
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
-
#
|
12
|
-
# $ mkdir config
|
13
|
-
# $ mv Guardfile config/
|
14
|
-
# $ ln -s config/Guardfile .
|
15
|
-
#
|
16
|
-
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
-
|
18
|
-
guard :minitest do
|
19
|
-
# with Minitest::Unit
|
20
|
-
watch(%r{^test/(.*)
|
21
|
-
watch(%r{^lib/(.*/)?([^/]+)\.rb$})
|
22
|
-
watch(%r{^test/test_helper\.rb$})
|
23
|
-
|
24
|
-
# with Minitest::Spec
|
25
|
-
# watch(%r{^spec/(.*)_spec\.rb$})
|
26
|
-
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
27
|
-
# watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
28
|
-
|
29
|
-
|
30
|
-
end
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
guard :minitest do
|
19
|
+
# with Minitest::Unit
|
20
|
+
watch(%r{^test/(.*)/?test_(.*)\.rb$})
|
21
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
22
|
+
watch(%r{^test/test_helper\.rb$}) { "test" }
|
23
|
+
|
24
|
+
# with Minitest::Spec
|
25
|
+
# watch(%r{^spec/(.*)_spec\.rb$})
|
26
|
+
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
27
|
+
# watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
28
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Copyright (
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 dsisnero
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
21
|
THE SOFTWARE.
|
22
|
-
....
|
data/README.md
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
# DESCRIPTION:
|
2
|
+
|
3
|
+
The acrobat gem is a library that uses WIN32OLE to automate pdf
|
4
|
+
functions. Adobe Reader or Adobe Acrobat must be installed and then you
|
5
|
+
can fill forms and merge documents
|
6
|
+
|
7
|
+
# Requirements
|
8
|
+
|
9
|
+
- Windows Adobe Acrobat installed
|
10
|
+
|
11
|
+
# Install 0ptions
|
12
|
+
|
13
|
+
acrobat can be installed using (a) the `gem install` command, (b)
|
14
|
+
Bundler
|
15
|
+
|
16
|
+
## (a) gem install
|
17
|
+
|
18
|
+
Open a terminal and type \$ gem install acrobat
|
19
|
+
|
20
|
+
:::: tip
|
21
|
+
::: title
|
22
|
+
Upgrading your installation
|
23
|
+
:::
|
24
|
+
|
25
|
+
If you have an earlier version of acrobat installed you can update it
|
26
|
+
using:
|
27
|
+
|
28
|
+
\$ gem update acrobat
|
29
|
+
|
30
|
+
If you install a new version of the gem using `gem install` instead of
|
31
|
+
gem update, you'll have multiple versions installed. If that's the case,
|
32
|
+
use the following gem command to remove the old versions:
|
33
|
+
|
34
|
+
\$ gem cleanup acrobat
|
35
|
+
::::
|
36
|
+
|
37
|
+
## (b) Bundler
|
38
|
+
|
39
|
+
1. Create a Gemfile in the root folder of your project (or the current
|
40
|
+
directory)
|
41
|
+
|
42
|
+
2. Add the `asciidoctor` gem to your Gemfile as follows:
|
43
|
+
|
44
|
+
``` ruby
|
45
|
+
source 'https://rubygems.org'
|
46
|
+
gem 'acrobat'
|
47
|
+
# or specify the version explicitly
|
48
|
+
# gem 'acrobat', '0.0.5'
|
49
|
+
```
|
50
|
+
|
51
|
+
3. Save the Gemfile
|
52
|
+
|
53
|
+
4. Open a terminal and install the gem using:
|
54
|
+
|
55
|
+
$ bundle
|
56
|
+
|
57
|
+
To upgrade the gem, specify the new version in the Gemfile and run
|
58
|
+
`bundle` again. Using `bundle update` is **not** recommended as it will
|
59
|
+
also update other gems, which may not be the desired result.
|
60
|
+
|
61
|
+
# Usage
|
62
|
+
|
63
|
+
``` ruby
|
64
|
+
require 'acrobat'
|
65
|
+
Adobe::Acrobat.run do |app|
|
66
|
+
fields = {city: 'City', state: 'State', zip: 'zip'}
|
67
|
+
doc = app.open('apd_document.pdf')
|
68
|
+
doc.fill_form(fields)
|
69
|
+
doc.show
|
70
|
+
doc2 = app.open('another_doc.pdf')
|
71
|
+
doc2.fill_form(fields)
|
72
|
+
doc1.merge_doc(doc2)
|
73
|
+
doc1.save_as(name: 'merged_doc.pdf', dir: 'tmp')
|
74
|
+
end
|
75
|
+
```
|
76
|
+
|
77
|
+
# Getting Help
|
78
|
+
|
79
|
+
We encourage you to ask questions and discuss any aspects of the project
|
80
|
+
on the discussion list, Twitter or IRC.
|
81
|
+
|
82
|
+
Mailing list
|
83
|
+
|
84
|
+
: {uri-discuss}
|
85
|
+
|
86
|
+
The project's source code, issue tracker, and sub-projects are on github
|
87
|
+
|
88
|
+
Source repository (git)
|
89
|
+
|
90
|
+
: <https://github.com/dsisnero/acrobat>
|
91
|
+
|
92
|
+
Issue tracker
|
93
|
+
|
94
|
+
: <https://github.com/dsisnero/acrobat/issues>
|
95
|
+
|
96
|
+
acrobat organization on GitHub
|
97
|
+
|
98
|
+
: <https://github.com/dsisnero>
|
99
|
+
|
100
|
+
# Copyright and Licensing
|
101
|
+
|
102
|
+
Copyright © 2012-2016 Dominic Sisneros and the acrobat-Ruby Project.
|
103
|
+
Free use of this software is granted under the terms of the MIT License.
|
104
|
+
|
105
|
+
See the
|
106
|
+
[LICENSE](https://github.com/dsisnero/acrobat/blob/master/LICENSE.txt)
|
107
|
+
file for details.
|
data/Rakefile
CHANGED
@@ -1,58 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
4
|
-
require "
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "minitest/test_task"
|
5
5
|
|
6
|
-
|
6
|
+
Minitest::TestTask.create
|
7
7
|
|
8
|
-
|
9
|
-
'home' => 'uri-repo',
|
10
|
-
'bugs' => 'uri-issues',
|
11
|
-
'code' => 'uri-repo',
|
12
|
-
'clog' => 'uri-changelog'
|
13
|
-
}
|
8
|
+
require "standard/rake"
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
def intuit_values(input)
|
19
|
-
require 'asciidoctor'
|
20
|
-
doc = Asciidoctor.load_file readme_file
|
21
|
-
urls = ASCIIDOC_URI_TO_METADATA.to_h{ |k,v| [k, doc.attributes[v]]}
|
22
|
-
desc = doc.blocks.find{|b| b.id =~ /description/i}.content
|
23
|
-
summ = desc.split(/\.\s+/).first(summary_sentences).join(". ")
|
24
|
-
self.urls ||= urls
|
25
|
-
self.description ||= desc
|
26
|
-
self.summary ||= summ
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
# Hoe.plugin :compiler
|
32
|
-
# Hoe.plugin :gem_prelude_sucks
|
33
|
-
# Hoe.plugin :inline
|
34
|
-
# Hoe.plugin :racc
|
35
|
-
# Hoe.plugin :rcov
|
36
|
-
# Hoe.plugin :rdoc
|
37
|
-
Hoe.plugin :bundler
|
38
|
-
Hoe.plugin :minitest
|
39
|
-
Hoe.plugin :yard
|
40
|
-
|
41
|
-
Hoe.spec "acrobat" do |s|
|
42
|
-
dependency("hoe-bundler", "~> 1.4",:development)
|
43
|
-
dependency("hoe-yard", "> 0.1",:development)
|
44
|
-
dependency("pry", "> 0.0", :development)
|
45
|
-
dependency("pry-byebug", "> 0.0", :development)
|
46
|
-
dependency("yard", "> 0.0", :development)
|
47
|
-
dependency("guard", "> 0.0", :development)
|
48
|
-
dependency("wdm", "> 0.1", :development) if Gem.win_platform?
|
49
|
-
dependency("guard-minitest", "> 0.0", :development)
|
50
|
-
dependency("asciidoctor", "> 0.0",:development)
|
51
|
-
# dependency("minitest-utils", "> 0.0", :development)
|
52
|
-
developer("Dominic Sisneros","dsisnero@gmail.com")
|
53
|
-
clean_globs << "tmp"
|
54
|
-
license "MIT" # this should match the license in the README
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
|
-
# vim: syntax=ruby
|
10
|
+
task default: %i[test standard]
|
Binary file
|
Binary file
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "acrobat"
|
2
|
+
require "pry"
|
3
|
+
|
4
|
+
Acrobat::App.new
|
5
|
+
# app.show
|
6
|
+
|
7
|
+
|
8
|
+
Acrobat::App.run do |app|
|
9
|
+
dir = Pathname(__dir__)
|
10
|
+
form_path = dir + "6030.17.antenna.pdf"
|
11
|
+
puts "Working on #{form_path}"
|
12
|
+
doc1 = app.open(form_path)
|
13
|
+
doc1.show
|
14
|
+
fields = {"city" => "Salt Lake City",
|
15
|
+
"state" => "Utah",
|
16
|
+
"lid" => "SLCB",
|
17
|
+
"fac" => "RTR",
|
18
|
+
:cost_center => "1234"}
|
19
|
+
doc1.fill_form(fields)
|
20
|
+
doc1.save_as(name: "slcb.example.pdf", dir: dir.parent + "tmp")
|
21
|
+
end
|
data/examples/merge.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require "acrobat/app"
|
2
|
+
require "pry"
|
3
|
+
Acrobat::App.run do |app|
|
4
|
+
dir = Pathname(__dir__)
|
5
|
+
form_path = dir + "6030.17.antenna.pdf"
|
6
|
+
doc = app.open(form_path)
|
7
|
+
binding.pry
|
8
|
+
doc.merge(dir + "6030.17.cm300.tx.pdf")
|
9
|
+
doc.show
|
10
|
+
doc.save_as(name: "example.merged.pdf", dir: dir.parent + "tmp")
|
11
|
+
end
|