File: watermark.pl

package info (click to toggle)
libexcel-writer-xlsx-perl 1.11-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 18,096 kB
  • sloc: perl: 22,147; makefile: 41
file content (24 lines) | stat: -rw-r--r-- 787 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
23
24
#!/usr/bin/perl -w

#######################################################################
#
# An example of adding a worksheet watermark image using the Excel::Writer::XLSX
# module. This is based on the method of putting an image in the worksheet
# header as suggested in the Microsoft documentation:
# https://support.microsoft.com/en-us/office/add-a-watermark-in-excel-a372182a-d733-484e-825c-18ddf3edf009
#
# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org
#

use strict;
use Excel::Writer::XLSX;

my $workbook  = Excel::Writer::XLSX->new( 'watermark.xlsx' );
my $worksheet = $workbook->add_worksheet();

# Set a worksheet header with the watermark image.
$worksheet->set_header( '&C&C&[Picture]', undef, { image_center => 'watermark.png' } );

$workbook->close();

__END__