API2/Basic/PDF/Utils.pm

filter: Statementstmt 97.9% 47 / 48 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 95.0% 19 / 20 Podpod 88.8% 8 / 9 totaltotal 96.1% 74 / 77 SCAR 0.0
CC
1
Cov
98%
PDFUtf
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« API2/Resource/PaperSizes.pm ↑ Summary API2/Resource/XObject/Form/BarCode/codabar.pm »
1 # Code in the PDF::API2::Basic::PDF namespace was originally copied from the
2 # Text::PDF distribution.
3 #
4 # Copyright Martin Hosken <Martin_Hosken@sil.org>
5 #
6 # Martin Hosken's code may be used under the terms of the MIT license.
7 # Subsequent versions of the code have the same license as PDF::API2.
8  
9 package PDF::API2::Basic::PDF::Utils;
10  
11 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 40 our $VERSION = '2.044'; # VERSION
14  
15 =head1 NAME
16  
17 PDF::API2::Basic::PDF::Utils - Convenience functions for creating low-level PDF
18 objects
19  
20 =head1 DESCRIPTION
21  
22 A set of utility functions to save the fingers of the PDF library users!
23  
24 =head1 FUNCTIONS
25  
26 =cut
27  
28 40 ▶use PDF::API2::Basic::PDF::Array;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 40 ▶use PDF::API2::Basic::PDF::Bool;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 40 ▶use PDF::API2::Basic::PDF::Dict;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 40 ▶use PDF::API2::Basic::PDF::Name;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 40 ▶use PDF::API2::Basic::PDF::Null;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 40 ▶use PDF::API2::Basic::PDF::Number;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 40 ▶use PDF::API2::Basic::PDF::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 40 ▶use PDF::API2::Basic::PDF::Literal;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 40 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 40 ▶use vars qw(@EXPORT @ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
39 40 @ISA = qw(Exporter);
40 40 @EXPORT = qw(PDFBool PDFArray PDFDict PDFName PDFNull
41 PDFNum PDFStr PDFStrHex PDFUtf);
42  
43 =head2 PDFBool
44  
45 Creates a Bool via PDF::API2::Basic::PDF::Bool->new
46  
47 =cut
48  
49 sub PDFBool {
50 3 ▶ return PDF::API2::Basic::PDF::Bool->new(@_);
Subroutine PDFBool: called CC=1 SCAR=0.0
Pod documented
51 }
52  
53 =head2 PDFArray
54  
55 Creates an array via PDF::API2::Basic::PDF::Array->new
56  
57 =cut
58  
59 sub PDFArray {
60 773 ▶ return PDF::API2::Basic::PDF::Array->new(@_);
Subroutine PDFArray: called CC=1 SCAR=0.0
Pod documented
61 }
62  
63 =head2 PDFDict
64  
65 Creates a dict via PDF::API2::Basic::PDF::Dict->new
66  
67 =cut
68  
69 sub PDFDict {
70 1095 ▶ return PDF::API2::Basic::PDF::Dict->new(@_);
Subroutine PDFDict: called CC=1 SCAR=0.0
Pod documented
71 }
72  
73 =head2 PDFName
74  
75 Creates a name via PDF::API2::Basic::PDF::Name->new
76  
77 =cut
78  
79 sub PDFName {
80 16816 ▶ return PDF::API2::Basic::PDF::Name->new(@_);
Subroutine PDFName: called CC=1 SCAR=0.0
Pod documented
81 }
82  
83 =head2 PDFNull
84  
85 Creates a null via PDF::API2::Basic::PDF::Null->new
86  
87 =cut
88  
89 sub PDFNull {
90 12 ▶ return PDF::API2::Basic::PDF::Null->new(@_);
Subroutine PDFNull: called CC=1 SCAR=0.0
Pod documented
91 }
92  
93 =head2 PDFNum
94  
95 Creates a number via PDF::API2::Basic::PDF::Number->new
96  
97 =cut
98  
99 sub PDFNum {
100 13323 ▶ return PDF::API2::Basic::PDF::Number->new(@_);
Subroutine PDFNum: called CC=1 SCAR=0.0
Pod documented
101 }
102  
103 =head2 PDFStr
104  
105 Creates a string via PDF::API2::Basic::PDF::String->new
106  
107 =cut
108  
109 sub PDFStr {
110 185 ▶ return PDF::API2::Basic::PDF::String->new(@_);
Subroutine PDFStr: called CC=1 SCAR=0.0
Pod documented
111 }
112  
113 # Deprecated
114 0 ▶sub PDFUtf { return PDFStr(@_) }
Subroutine PDFUtf: not called CC=1 SCAR=6.9
Pod undocumented
115  
116 =head2 PDFStrHex
117  
118 Creates a hex-string via PDF::API2::Basic::PDF::String->new
119  
120 =cut
121  
122 sub PDFStrHex {
123 1 ▶ my $string = PDF::API2::Basic::PDF::String->new(@_);
Subroutine PDFStrHex: called CC=1 SCAR=0.0
Pod documented
124 1 $string->{' ishex'} = 1;
125 1 return $string;
126 }
127  
128 40 1;
« API2/Resource/PaperSizes.pm ↑ Summary API2/Resource/XObject/Form/BarCode/codabar.pm »