File: extgstate.rb

package info (click to toggle)
ruby-pdf-inspector 1.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 176 kB
  • sloc: ruby: 293; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module PDF
  class Inspector
    class ExtGState < Inspector
      attr_accessor :extgstates

      def initialize
        @extgstates = []
      end

      def page=(page)
        page.graphic_states.each do |_label, stream|
          @extgstates << {
            opacity: stream[:ca],
            stroke_opacity: stream[:CA],
            soft_mask: stream[:SMask],
            blend_mode: stream[:BM]
          }
        end
      end
    end
  end
end