| 1 | package SelectPdf::ApiEnums; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | our $VERSION = '1.6.0'; | |
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | SelectPdf::ApiEnums - Named constants for the values accepted by the SelectPdf Online API client setters. | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | Every setter that takes one of these values also accepts the plain value (for example C<"PdfA3B">, C<"Chromium"> or C<2>). | ||
| 14 | The constants exist so the allowed values are discoverable and typos are caught at compile time: | ||
| 15 | |||
| 16 | use SelectPdf; | ||
| 17 | |||
| 18 | my $client = SelectPdf::HtmlToPdfClient->new($apiKey); | ||
| 19 | $client | ||
| 20 | ->setRenderingEngine(SelectPdf::RenderingEngine::Chromium) | ||
| 21 | ->setPdfStandard(SelectPdf::PdfStandard::PdfA3B) | ||
| 22 | ->setPageNumbersAlignment(SelectPdf::PageNumbersAlignment::Center) | ||
| 23 | ; | ||
| 24 | |||
| 25 | my $invoice = SelectPdf::InvoiceClient->new($apiKey); | ||
| 26 | $invoice->setZugferdProfile(SelectPdf::ZugferdProfile::En16931); | ||
| 27 | |||
| 28 | The same constants can also be called as class methods, e.g. C<< SelectPdf::PdfStandard->PdfA3B >>. | ||
| 29 | |||
| 30 | =head1 CONSTANTS | ||
| 31 | |||
| 32 | =head2 SelectPdf::PageSize | ||
| 33 | |||
| 34 | PDF page size: C<Custom>, C<A0>, C<A1>, C<A2>, C<A3>, C<A4>, C<A5>, C<A6>, C<A7>, C<A8>, C<Letter>, C<HalfLetter>, C<Ledger>, C<Legal>. | ||
| 35 | |||
| 36 | =head2 SelectPdf::PageOrientation | ||
| 37 | |||
| 38 | PDF page orientation: C<Portrait>, C<Landscape>. | ||
| 39 | |||
| 40 | =head2 SelectPdf::RenderingEngine | ||
| 41 | |||
| 42 | Rendering engine used for HTML to PDF conversion: C<WebKit>, C<Restricted> (WebKit Restricted), C<Blink>, C<Chromium>. | ||
| 43 | |||
| 44 | =head2 SelectPdf::SecureProtocol | ||
| 45 | |||
| 46 | Protocol used for secure (HTTPS) connections: C<Tls11OrNewer> (0, recommended), C<Tls10> (1), C<Ssl3> (2). | ||
| 47 | |||
| 48 | =head2 SelectPdf::PageLayout | ||
| 49 | |||
| 50 | The page layout used when the PDF document is opened in a viewer: C<SinglePage> (0), C<OneColumn> (1), C<TwoColumnLeft> (2), C<TwoColumnRight> (3). | ||
| 51 | |||
| 52 | =head2 SelectPdf::PageMode | ||
| 53 | |||
| 54 | The PDF document's page mode: C<UseNone> (0), C<UseOutlines> (1), C<UseThumbs> (2), C<FullScreen> (3), C<UseOC> (4), C<UseAttachments> (5). | ||
| 55 | |||
| 56 | =head2 SelectPdf::PageNumbersAlignment | ||
| 57 | |||
| 58 | Alignment for page numbers: C<Left> (1), C<Center> (2), C<Right> (3). | ||
| 59 | |||
| 60 | =head2 SelectPdf::StartupMode | ||
| 61 | |||
| 62 | Converter startup mode: C<Automatic> (the conversion starts right after the page loads), C<Manual> (the conversion starts only when called from JavaScript). | ||
| 63 | |||
| 64 | =head2 SelectPdf::TextLayout | ||
| 65 | |||
| 66 | Output text layout for PDF to text calls: C<Original> (0), C<Reading> (1). | ||
| 67 | |||
| 68 | =head2 SelectPdf::OutputFormat | ||
| 69 | |||
| 70 | Output format for PDF to text calls: C<Text> (0), C<Html> (1). | ||
| 71 | |||
| 72 | =head2 SelectPdf::PdfStandard | ||
| 73 | |||
| 74 | PDF conformance target for the generated document: | ||
| 75 | |||
| 76 | =over | ||
| 77 | |||
| 78 | =item * C<Full> - the complete PDF feature set. Default. | ||
| 79 | |||
| 80 | =item * C<PdfA> - PDF/A, long term archiving. | ||
| 81 | |||
| 82 | =item * C<PdfA2B> - PDF/A-2B, long term archiving, transparencies allowed. | ||
| 83 | |||
| 84 | =item * C<PdfA3A> - PDF/A-3A, the accessible level of PDF/A-3. Implies a tagged document and can carry a ZUGFeRD / Factur-X electronic invoice. | ||
| 85 | |||
| 86 | =item * C<PdfA3B> - PDF/A-3B, long term archiving with arbitrary embedded files. Can carry a ZUGFeRD / Factur-X electronic invoice. | ||
| 87 | |||
| 88 | =item * C<PdfA3U> - PDF/A-3U, PDF/A-3B with Unicode mapping for all text. Can carry a ZUGFeRD / Factur-X electronic invoice. | ||
| 89 | |||
| 90 | =item * C<PdfX> - PDF/X, graphics exchange. | ||
| 91 | |||
| 92 | =item * C<PdfSiqQ_A> - PDF/SiqQ Level A, suitable for digital signatures, external links disabled. | ||
| 93 | |||
| 94 | =item * C<PdfSiqQ_B> - PDF/SiqQ Level B, suitable for digital signatures. | ||
| 95 | |||
| 96 | =back | ||
| 97 | |||
| 98 | Tagged standards (PdfA3A) require the Blink or Chromium rendering engine. When no engine is specified the API promotes the | ||
| 99 | request to Chromium and reports the engine used in the X-SelectPdf-Engine response header. | ||
| 100 | |||
| 101 | =head2 SelectPdf::ZugferdProfile | ||
| 102 | |||
| 103 | The data profile of a ZUGFeRD / Factur-X hybrid electronic invoice: | ||
| 104 | |||
| 105 | =over | ||
| 106 | |||
| 107 | =item * C<Minimum> - MINIMUM, accounting information only. Not a complete invoice. | ||
| 108 | |||
| 109 | =item * C<Basic_WL> - BASIC WL, header and footer data without invoice lines. Not a complete invoice. | ||
| 110 | |||
| 111 | =item * C<Basic> - BASIC, a subset of EN 16931 covering simple invoices, with lines. | ||
| 112 | |||
| 113 | =item * C<En16931> - EN 16931 (formerly COMFORT), the full European semantic standard. | ||
| 114 | |||
| 115 | =item * C<Extended> - EXTENDED, EN 16931 plus additional business terms. | ||
| 116 | |||
| 117 | =item * C<XRechnung> - XRECHNUNG, the German public-sector reference profile. The embedded file is named xrechnung.xml instead of factur-x.xml. | ||
| 118 | |||
| 119 | =back | ||
| 120 | |||
| 121 | =head2 SelectPdf::ZugferdRelationship | ||
| 122 | |||
| 123 | How the embedded invoice XML relates to the visible invoice page: | ||
| 124 | |||
| 125 | =over | ||
| 126 | |||
| 127 | =item * C<Data> - the XML and the visible page carry exactly the same invoice content. Mandatory in Germany for the Basic, En16931, Extended and XRechnung profiles. | ||
| 128 | |||
| 129 | =item * C<Alternative> - the visible page carries more than the XML does (always the case for the Minimum and Basic_WL profiles), or the page was generated from the XML. | ||
| 130 | |||
| 131 | =item * C<Source> - the XML is the source the visible page was produced from. | ||
| 132 | |||
| 133 | =item * C<Supplement> - the XML supplements the visible page. | ||
| 134 | |||
| 135 | =back | ||
| 136 | |||
| 137 | When not set, the API derives this from the profile: Alternative for Minimum and Basic_WL, Data for the rest. | ||
| 138 | Minimum and Basic_WL combined with Data are rejected, because those profiles do not carry a complete invoice. | ||
| 139 | |||
| 140 | =head2 SelectPdf::ZugferdSchema | ||
| 141 | |||
| 142 | The metadata schema used to identify a hybrid invoice inside the PDF: | ||
| 143 | |||
| 144 | =over | ||
| 145 | |||
| 146 | =item * C<FacturX10> - Factur-X 1.0 / ZUGFeRD 2.x, the current schema. Default. | ||
| 147 | |||
| 148 | =item * C<Zugferd20> - ZUGFeRD 2.0, the legacy schema, deprecated but still accepted. Use only for recipients that explicitly require it. | ||
| 149 | |||
| 150 | =back | ||
| 151 | |||
| 152 | =cut | ||
| 153 | |||
| 154 | package SelectPdf::PageSize; | ||
| 155 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 156 | 1 | Custom => 'Custom', A0 => 'A0', A1 => 'A1', A2 => 'A2', A3 => 'A3', A4 => 'A4', A5 => 'A5', | |
| 157 | A6 => 'A6', A7 => 'A7', A8 => 'A8', Letter => 'Letter', HalfLetter => 'HalfLetter', | ||
| 158 | Ledger => 'Ledger', Legal => 'Legal', | ||
| 159 | 1 | }; | |
| 160 | |||
| 161 | package SelectPdf::PageOrientation; | ||
| 162 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 163 | 1 | Portrait => 'Portrait', Landscape => 'Landscape', | |
| 164 | 1 | }; | |
| 165 | |||
| 166 | package SelectPdf::RenderingEngine; | ||
| 167 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 168 | 1 | WebKit => 'WebKit', Restricted => 'Restricted', Blink => 'Blink', Chromium => 'Chromium', | |
| 169 | 1 | }; | |
| 170 | |||
| 171 | package SelectPdf::SecureProtocol; | ||
| 172 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 173 | 1 | Tls11OrNewer => 0, Tls10 => 1, Ssl3 => 2, | |
| 174 | 1 | }; | |
| 175 | |||
| 176 | package SelectPdf::PageLayout; | ||
| 177 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 178 | 1 | SinglePage => 0, OneColumn => 1, TwoColumnLeft => 2, TwoColumnRight => 3, | |
| 179 | 1 | }; | |
| 180 | |||
| 181 | package SelectPdf::PageMode; | ||
| 182 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 183 | 1 | UseNone => 0, UseOutlines => 1, UseThumbs => 2, FullScreen => 3, UseOC => 4, UseAttachments => 5, | |
| 184 | 1 | }; | |
| 185 | |||
| 186 | package SelectPdf::PageNumbersAlignment; | ||
| 187 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 188 | 1 | Left => 1, Center => 2, Right => 3, | |
| 189 | 1 | }; | |
| 190 | |||
| 191 | package SelectPdf::StartupMode; | ||
| 192 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 193 | 1 | Automatic => 'Automatic', Manual => 'Manual', | |
| 194 | 1 | }; | |
| 195 | |||
| 196 | package SelectPdf::TextLayout; | ||
| 197 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 198 | 1 | Original => 0, Reading => 1, | |
| 199 | 1 | }; | |
| 200 | |||
| 201 | package SelectPdf::OutputFormat; | ||
| 202 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 203 | 1 | Text => 0, Html => 1, | |
| 204 | 1 | }; | |
| 205 | |||
| 206 | package SelectPdf::PdfStandard; | ||
| 207 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 208 | 1 | Full => 'Full', PdfA => 'PdfA', PdfA2B => 'PdfA2B', PdfA3A => 'PdfA3A', PdfA3B => 'PdfA3B', | |
| 209 | PdfA3U => 'PdfA3U', PdfX => 'PdfX', PdfSiqQ_A => 'PdfSiqQ_A', PdfSiqQ_B => 'PdfSiqQ_B', | ||
| 210 | 1 | }; | |
| 211 | |||
| 212 | package SelectPdf::ZugferdProfile; | ||
| 213 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 214 | 1 | Minimum => 'Minimum', Basic_WL => 'Basic_WL', Basic => 'Basic', En16931 => 'En16931', | |
| 215 | Extended => 'Extended', XRechnung => 'XRechnung', | ||
| 216 | 1 | }; | |
| 217 | |||
| 218 | package SelectPdf::ZugferdRelationship; | ||
| 219 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 220 | 1 | Data => 'Data', Alternative => 'Alternative', Source => 'Source', Supplement => 'Supplement', | |
| 221 | 1 | }; | |
| 222 | |||
| 223 | package SelectPdf::ZugferdSchema; | ||
| 224 | 1 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 225 | 1 | FacturX10 => 'FacturX10', Zugferd20 => 'Zugferd20', | |
| 226 | 1 | }; | |
| 227 | |||
| 228 | 1 | 1; | |