1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use PDF::Builder;
my $pdf = PDF::Builder->new();
# 1
like($pdf->producer(), qr/PDF::Builder/,
q{Producer is set on PDF creation});
$pdf->producer('Test');
# 2
is($pdf->producer(), 'Test',
q{Producer can be changed});
# 3
$pdf->producer(undef);
ok(!$pdf->producer(),
q{Producer can be cleared});
# 4
$pdf->created('D:20000101000000Z');
like($pdf->to_string(),
qr{/CreationDate \(D:20000101000000Z\)},
q{CreationDate is correctly encoded});
# 5
$pdf = PDF::Builder->new(); # not sure why have to get a fresh PDF object...
# did some test upstream corrupt it?
$pdf->modified("D:20230402144932-04'00");
like($pdf->to_string(),
qr{/ModDate \(D:20230402144932-04'00\)},
q{ModDate is correctly encoded});
done_testing();
|