mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
656 B
24 lines
656 B
# # Images
|
|
#
|
|
# This example shows how to embed images into a PDF document, directly on a
|
|
# page's canvas and through the high-level [HexaPDF::Composer].
|
|
#
|
|
# Usage:
|
|
# : `ruby digital-signatures.rb`
|
|
#
|
|
|
|
require 'hexapdf'
|
|
require HexaPDF.data_dir + '/cert/demo_cert.rb'
|
|
|
|
doc = if ARGV[0]
|
|
HexaPDF::Document.open(ARGV[0])
|
|
else
|
|
HexaPDF::Document.new.pages.add.document
|
|
end
|
|
doc.sign("digital-signatures.pdf",
|
|
reason: 'Some reason',
|
|
certificate: HexaPDF.demo_cert.cert,
|
|
key: HexaPDF.demo_cert.key,
|
|
certificate_chain: [HexaPDF.demo_cert.sub_ca,
|
|
HexaPDF.demo_cert.root_ca])
|