1PDF::API2(3)          User Contributed Perl Documentation         PDF::API2(3)
2
3
4

NAME

6       PDF::API2 - Facilitates the creation and modification of PDF files
7

SYNOPSIS

9           use PDF::API2;
10
11           # Create a blank PDF file
12           $pdf = PDF::API2->new();
13
14           # Open an existing PDF file
15           $pdf = PDF::API2->open('some.pdf');
16
17           # Add a blank page
18           $page = $pdf->page();
19
20           # Retrieve an existing page
21           $page = $pdf->openpage($page_number);
22
23           # Set the page size
24           $page->mediabox('Letter');
25
26           # Add a built-in font to the PDF
27           $font = $pdf->corefont('Helvetica-Bold');
28
29           # Add an external TTF font to the PDF
30           $font = $pdf->ttfont('/path/to/font.ttf');
31
32           # Add some text to the page
33           $text = $page->text();
34           $text->font($font, 20);
35           $text->translate(200, 700);
36           $text->text('Hello World!');
37
38           # Save the PDF
39           $pdf->saveas('/path/to/new.pdf');
40

GENERIC METHODS

42       $pdf = PDF::API2->new(%options)
43           Creates a new PDF object.  If you will be saving it as a file and
44           already know the filename, you can give the '-file' option to
45           minimize possible memory requirements later on.
46
47           Example:
48
49               $pdf = PDF::API2->new();
50               ...
51               print $pdf->stringify();
52
53               $pdf = PDF::API2->new();
54               ...
55               $pdf->saveas('our/new.pdf');
56
57               $pdf = PDF::API2->new(-file => 'our/new.pdf');
58               ...
59               $pdf->save();
60
61       $pdf = PDF::API2->open($pdf_file)
62           Opens an existing PDF file.
63
64           Example:
65
66               $pdf = PDF::API2->open('our/old.pdf');
67               ...
68               $pdf->saveas('our/new.pdf');
69
70               $pdf = PDF::API2->open('our/to/be/updated.pdf');
71               ...
72               $pdf->update();
73
74       $pdf = PDF::API2->open_scalar($pdf_string)
75           Opens a PDF contained in a string.
76
77           Example:
78
79               # Read a PDF into a string, for the purpose of demonstration
80               open $fh, 'our/old.pdf' or die $@;
81               undef $/;  # Read the whole file at once
82               $pdf_string = <$fh>;
83
84               $pdf = PDF::API2->open_scalar($pdf_string);
85               ...
86               $pdf->saveas('our/new.pdf');
87
88       $pdf->preferences(%options)
89           Controls viewing preferences for the PDF.
90
91           Page Mode Options:
92
93           -fullscreen
94               Full-screen mode, with no menu bar, window controls, or any
95               other window visible.
96
97           -thumbs
98               Thumbnail images visible.
99
100           -outlines
101               Document outline visible.
102
103           Page Layout Options:
104
105           -singlepage
106               Display one page at a time.
107
108           -onecolumn
109               Display the pages in one column.
110
111           -twocolumnleft
112               Display the pages in two columns, with oddnumbered pages on the
113               left.
114
115           -twocolumnright
116               Display the pages in two columns, with oddnumbered pages on the
117               right.
118
119           Viewer Options:
120
121           -hidetoolbar
122               Specifying whether to hide tool bars.
123
124           -hidemenubar
125               Specifying whether to hide menu bars.
126
127           -hidewindowui
128               Specifying whether to hide user interface elements.
129
130           -fitwindow
131               Specifying whether to resize the document's window to the size
132               of the displayed page.
133
134           -centerwindow
135               Specifying whether to position the document's window in the
136               center of the screen.
137
138           -displaytitle
139               Specifying whether the window's title bar should display the
140               document title taken from the Title entry of the document
141               information dictionary.
142
143           -afterfullscreenthumbs
144               Thumbnail images visible after Full-screen mode.
145
146           -afterfullscreenoutlines
147               Document outline visible after Full-screen mode.
148
149           -printscalingnone
150               Set the default print setting for page scaling to none.
151
152           -simplex
153               Print single-sided by default.
154
155           -duplexflipshortedge
156               Print duplex by default and flip on the short edge of the
157               sheet.
158
159           -duplexfliplongedge
160               Print duplex by default and flip on the long edge of the sheet.
161
162           Initial Page Options:
163
164           -firstpage => [ $page, %options ]
165               Specifying the page (either a page number or a page object) to
166               be displayed, plus one of the following options:
167
168               -fit => 1
169                   Display the page designated by page, with its contents
170                   magnified just enough to fit the entire page within the
171                   window both horizontally and vertically. If the required
172                   horizontal and vertical magnification factors are
173                   different, use the smaller of the two, centering the page
174                   within the window in the other dimension.
175
176               -fith => $top
177                   Display the page designated by page, with the vertical
178                   coordinate top positioned at the top edge of the window and
179                   the contents of the page magnified just enough to fit the
180                   entire width of the page within the window.
181
182               -fitv => $left
183                   Display the page designated by page, with the horizontal
184                   coordinate left positioned at the left edge of the window
185                   and the contents of the page magnified just enough to fit
186                   the entire height of the page within the window.
187
188               -fitr => [ $left, $bottom, $right, $top ]
189                   Display the page designated by page, with its contents
190                   magnified just enough to fit the rectangle specified by the
191                   coordinates left, bottom, right, and top entirely within
192                   the window both horizontally and vertically. If the
193                   required horizontal and vertical magnification factors are
194                   different, use the smaller of the two, centering the
195                   rectangle within the window in the other dimension.
196
197               -fitb => 1
198                   Display the page designated by page, with its contents
199                   magnified just enough to fit its bounding box entirely
200                   within the window both horizontally and vertically. If the
201                   required horizontal and vertical magnification factors are
202                   different, use the smaller of the two, centering the
203                   bounding box within the window in the other dimension.
204
205               -fitbh => $top
206                   Display the page designated by page, with the vertical
207                   coordinate top positioned at the top edge of the window and
208                   the contents of the page magnified just enough to fit the
209                   entire width of its bounding box within the window.
210
211               -fitbv => $left
212                   Display the page designated by page, with the horizontal
213                   coordinate left positioned at the left edge of the window
214                   and the contents of the page magnified just enough to fit
215                   the entire height of its bounding box within the window.
216
217               -xyz => [ $left, $top, $zoom ]
218                   Display the page designated by page, with the coordinates
219                   (left, top) positioned at the top-left corner of the window
220                   and the contents of the page magnified by the factor zoom.
221                   A zero (0) value for any of the parameters left, top, or
222                   zoom specifies that the current value of that parameter is
223                   to be retained unchanged.
224
225           Example:
226
227               $pdf->preferences(
228                   -fullscreen => 1,
229                   -onecolumn => 1,
230                   -afterfullscreenoutlines => 1,
231                   -firstpage => [$page, -fit => 1],
232               );
233
234       $val = $pdf->default($parameter)
235       $pdf->default($parameter, $value)
236           Gets/sets the default value for a behaviour of PDF::API2.
237
238           Supported Parameters:
239
240           nounrotate
241               prohibits API2 from rotating imported/opened page to re-create
242               a default pdf-context.
243
244           pageencaps
245               enables than API2 will add save/restore commands upon
246               imported/opened pages to preserve graphics-state for
247               modification.
248
249           copyannots
250               enables importing of annotations (*EXPERIMENTAL*).
251
252       $version = $pdf->version([$new_version])
253           Get/set the PDF version (e.g. 1.4)
254
255       $bool = $pdf->isEncrypted()
256           Checks if the previously opened PDF is encrypted.
257
258       %infohash = $pdf->info(%infohash)
259           Gets/sets the info structure of the document.
260
261           Example:
262
263               %h = $pdf->info(
264                   'Author'       => "Alfred Reibenschuh",
265                   'CreationDate' => "D:20020911000000+01'00'",
266                   'ModDate'      => "D:YYYYMMDDhhmmssOHH'mm'",
267                   'Creator'      => "fredos-script.pl",
268                   'Producer'     => "PDF::API2",
269                   'Title'        => "some Publication",
270                   'Subject'      => "perl ?",
271                   'Keywords'     => "all good things are pdf"
272               );
273               print "Author: $h{Author}\n";
274
275       @metadata_attributes = $pdf->infoMetaAttributes(@metadata_attributes)
276           Gets/sets the supported info-structure tags.
277
278           Example:
279
280               @attributes = $pdf->infoMetaAttributes;
281               print "Supported Attributes: @attr\n";
282
283               @attributes = $pdf->infoMetaAttributes('CustomField1');
284               print "Supported Attributes: @attributes\n";
285
286       $xml = $pdf->xmpMetadata($xml)
287           Gets/sets the XMP XML data stream.
288
289           Example:
290
291               $xml = $pdf->xmpMetadata();
292               print "PDFs Metadata reads: $xml\n";
293               $xml=<<EOT;
294               <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
295               <?adobe-xap-filters esc="CRLF"?>
296               <x:xmpmeta
297                 xmlns:x='adobe:ns:meta/'
298                 x:xmptk='XMP toolkit 2.9.1-14, framework 1.6'>
299                   <rdf:RDF
300                     xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
301                     xmlns:iX='http://ns.adobe.com/iX/1.0/'>
302                       <rdf:Description
303                         rdf:about='uuid:b8659d3a-369e-11d9-b951-000393c97fd8'
304                         xmlns:pdf='http://ns.adobe.com/pdf/1.3/'
305                         pdf:Producer='Acrobat Distiller 6.0.1 for Macintosh'></rdf:Description>
306                       <rdf:Description
307                         rdf:about='uuid:b8659d3a-369e-11d9-b951-000393c97fd8'
308                         xmlns:xap='http://ns.adobe.com/xap/1.0/'
309                         xap:CreateDate='2004-11-14T08:41:16Z'
310                         xap:ModifyDate='2004-11-14T16:38:50-08:00'
311                         xap:CreatorTool='FrameMaker 7.0'
312                         xap:MetadataDate='2004-11-14T16:38:50-08:00'></rdf:Description>
313                       <rdf:Description
314                         rdf:about='uuid:b8659d3a-369e-11d9-b951-000393c97fd8'
315                         xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/'
316                         xapMM:DocumentID='uuid:919b9378-369c-11d9-a2b5-000393c97fd8'/></rdf:Description>
317                       <rdf:Description
318                         rdf:about='uuid:b8659d3a-369e-11d9-b951-000393c97fd8'
319                         xmlns:dc='http://purl.org/dc/elements/1.1/'
320                         dc:format='application/pdf'>
321                           <dc:description>
322                             <rdf:Alt>
323                               <rdf:li xml:lang='x-default'>Adobe Portable Document Format (PDF)</rdf:li>
324                             </rdf:Alt>
325                           </dc:description>
326                           <dc:creator>
327                             <rdf:Seq>
328                               <rdf:li>Adobe Systems Incorporated</rdf:li>
329                             </rdf:Seq>
330                           </dc:creator>
331                           <dc:title>
332                             <rdf:Alt>
333                               <rdf:li xml:lang='x-default'>PDF Reference, version 1.6</rdf:li>
334                             </rdf:Alt>
335                           </dc:title>
336                       </rdf:Description>
337                   </rdf:RDF>
338               </x:xmpmeta>
339               <?xpacket end='w'?>
340               EOT
341
342               $xml = $pdf->xmpMetadata($xml);
343               print "PDF metadata now reads: $xml\n";
344
345       $pdf->pageLabel($index, $options)
346           Sets page label options.
347
348           Supported Options:
349
350           -style
351               Roman, roman, decimal, Alpha or alpha.
352
353           -start
354               Restart numbering at given number.
355
356           -prefix
357               Text prefix for numbering.
358
359           Example:
360
361               # Start with Roman Numerals
362               $pdf->pageLabel(0, {
363                   -style => 'roman',
364               });
365
366               # Switch to Arabic
367               $pdf->pageLabel(4, {
368                   -style => 'decimal',
369               });
370
371               # Numbering for Appendix A
372               $pdf->pageLabel(32, {
373                   -start => 1,
374                   -prefix => 'A-'
375               });
376
377               # Numbering for Appendix B
378               $pdf->pageLabel( 36, {
379                   -start => 1,
380                   -prefix => 'B-'
381               });
382
383               # Numbering for the Index
384               $pdf->pageLabel(40, {
385                   -style => 'Roman'
386                   -start => 1,
387                   -prefix => 'Index '
388               });
389
390       $pdf->finishobjects(@objects)
391           Force objects to be written to file if possible.
392
393           Example:
394
395               $pdf = PDF::API2->new(-file => 'our/new.pdf');
396               ...
397               $pdf->finishobjects($page, $gfx, $txt);
398               ...
399               $pdf->save();
400
401       $pdf->update()
402           Saves a previously opened document.
403
404           Example:
405
406               $pdf = PDF::API2->open('our/to/be/updated.pdf');
407               ...
408               $pdf->update();
409
410       $pdf->saveas($file)
411           Save the document to $file and remove the object structure from
412           memory.
413
414           Example:
415
416               $pdf = PDF::API2->new();
417               ...
418               $pdf->saveas('our/new.pdf');
419
420       $string = $pdf->stringify()
421           Return the document as a string and remove the object structure
422           from memory.
423
424           Example:
425
426               $pdf = PDF::API2->new();
427               ...
428               print $pdf->stringify();
429
430       $pdf->end()
431           Remove the object structure from memory.  PDF::API2 contains
432           circular references, so this call is necessary in long-running
433           processes to keep from running out of memory.
434
435           This will be called automatically when you save or stringify a PDF.
436           You should only need to call it explicitly if you are reading PDF
437           files and not writing them.
438

PAGE METHODS

440       $page = $pdf->page()
441       $page = $pdf->page($page_number)
442           Returns a new page object.  By default, the page is added to the
443           end of the document.  If you include an existing page number, the
444           new page will be inserted in that position, pushing existing pages
445           back.
446
447           If $page_number is -1, the new page is inserted as the second-last
448           page; if $page_number is 0, the new page is inserted as the last
449           page.
450
451           Example:
452
453               $pdf = PDF::API2->new();
454
455               # Add a page.  This becomes page 1.
456               $page = $pdf->page();
457
458               # Add a new first page.  $page becomes page 2.
459               $another_page = $pdf->page(1);
460
461       $page = $pdf->openpage($page_number)
462           Returns the PDF::API2::Page object of page $page_number.
463
464           If $page_number is 0 or -1, it will return the last page in the
465           document.
466
467           Example:
468
469               $pdf = PDF::API2->open('our/99page.pdf');
470               $page = $pdf->openpage(1);   # returns the first page
471               $page = $pdf->openpage(99);  # returns the last page
472               $page = $pdf->openpage(-1);  # returns the last page
473               $page = $pdf->openpage(999); # returns undef
474
475       $xoform = $pdf->importPageIntoForm($source_pdf, $source_page_number)
476           Returns a Form XObject created by extracting the specified page
477           from $source_pdf.
478
479           This is useful if you want to transpose the imported page somewhat
480           differently onto a page (e.g. two-up, four-up, etc.).
481
482           If $source_page_number is 0 or -1, it will return the last page in
483           the document.
484
485           Example:
486
487               $pdf = PDF::API2->new();
488               $old = PDF::API2->open('our/old.pdf');
489               $page = $pdf->page();
490               $gfx = $page->gfx();
491
492               # Import Page 2 from the old PDF
493               $xo = $pdf->importPageIntoForm($old, 2);
494
495               # Add it to the new PDF's first page at 1/2 scale
496               $gfx->formimage($xo, 0, 0, 0.5);
497
498               $pdf->saveas('our/new.pdf');
499
500           Note: You can only import a page from an existing PDF file.
501
502       $page = $pdf->import_page($source_pdf, $source_page_number,
503       $target_page_number)
504           Imports a page from $source_pdf and adds it to the specified
505           position in $pdf.
506
507           If $source_page_number or $target_page_number is 0 or -1, the last
508           page in the document is used.
509
510           Note: If you pass a page object instead of a page number for
511           $target_page_number, the contents of the page will be merged into
512           the existing page.
513
514           Example:
515
516               $pdf = PDF::API2->new();
517               $old = PDF::API2->open('our/old.pdf');
518
519               # Add page 2 from the old PDF as page 1 of the new PDF
520               $page = $pdf->import_page($old, 2);
521
522               $pdf->saveas('our/new.pdf');
523
524           Note: You can only import a page from an existing PDF file.
525
526       $count = $pdf->pages()
527           Returns the number of pages in the document.
528
529       ($llx, $lly, $urx, $ury) = $pdf->mediabox()
530       $pdf->mediabox($name)
531       $pdf->mediabox($w, $h)
532       $pdf->mediabox($llx, $lly, $urx, $ury)
533           Get or set the global mediabox.
534
535           Example:
536
537               $pdf = PDF::API2->new();
538               $pdf->mediabox('A4');
539               ...
540               $pdf->saveas('our/new.pdf');
541
542               $pdf = PDF::API2->new();
543               $pdf->mediabox(595, 842);
544               ...
545               $pdf->saveas('our/new.pdf');
546
547               $pdf = PDF::API2->new;
548               $pdf->mediabox(0, 0, 595, 842);
549               ...
550               $pdf->saveas('our/new.pdf');
551
552       ($llx, $lly, $urx, $ury) = $pdf->cropbox()
553       $pdf->cropbox($name)
554       $pdf->cropbox($w, $h)
555       $pdf->cropbox($llx, $lly, $urx, $ury)
556           Get or set the global cropbox.
557
558           The cropbox defaults to the mediabox.
559
560       ($llx, $lly, $urx, $ury) = $pdf->bleedbox()
561       $pdf->bleedbox($name)
562       $pdf->bleedbox($w, $h)
563       $pdf->bleedbox($llx, $lly, $urx, $ury)
564           Get or set the global bleedbox.
565
566           The bleedbox defaults to the cropbox.
567
568       ($llx, $lly, $urx, $ury) = $pdf->trimbox()
569       $pdf->trimbox($name)
570       $pdf->trimbox($w, $h)
571       $pdf->trimbox($llx, $lly, $urx, $ury)
572           Get or set the global trimbox.
573
574           The trimbox defaults to the cropbox.
575
576       ($llx, $lly, $urx, $ury) = $pdf->artbox()
577       $pdf->artbox($name)
578       $pdf->artbox($w, $h)
579       $pdf->artbox($llx, $lly, $urx, $ury)
580           Get or sets the global artbox.
581
582           The artbox defaults to the cropbox.
583

FONT METHODS

585       @directories = PDF::API2::addFontDirs($dir1, $dir2, ...)
586           Adds one or more directories to the search path for finding font
587           files.
588
589           Returns the list of searched directories.
590
591       $font = $pdf->corefont($fontname, [%options])
592           Returns a new Adobe core font object.
593
594           Examples:
595
596               $font = $pdf->corefont('Times-Roman');
597               $font = $pdf->corefont('Times-Bold');
598               $font = $pdf->corefont('Helvetica');
599               $font = $pdf->corefont('ZapfDingbats');
600
601           Valid %options are:
602
603           -encode
604               Changes the encoding of the font from its default.
605
606           -dokern
607               Enables kerning if data is available.
608
609           See Also: PDF::API2::Resource::Font::CoreFont.
610
611       $font = $pdf->psfont($ps_file, [%options])
612           Returns a new Adobe Type1 font object.
613
614           Examples:
615
616               $font = $pdf->psfont('Times-Book.pfa', -afmfile => 'Times-Book.afm');
617               $font = $pdf->psfont('/fonts/Synest-FB.pfb', -pfmfile => '/fonts/Synest-FB.pfm');
618
619           Valid %options are:
620
621           -encode
622               Changes the encoding of the font from its default.
623
624           -afmfile
625               Specifies the location of the font metrics file.
626
627           -pfmfile
628               Specifies the location of the printer font metrics file.  This
629               option overrides the -encode option.
630
631           -dokern
632               Enables kerning if data is available.
633
634       $font = $pdf->ttfont($ttf_file, [%options])
635           Returns a new TrueType or OpenType font object.
636
637           Examples:
638
639               $font = $pdf->ttfont('Times.ttf');
640               $font = $pdf->ttfont('Georgia.otf');
641
642           Valid %options are:
643
644           -encode
645               Changes the encoding of the font from its default.
646
647           -isocmap
648               Use the ISO Unicode Map instead of the default MS Unicode Map.
649
650           -dokern
651               Enables kerning if data is available.
652
653           -noembed
654               Disables embedding of the font file.
655
656       $font = $pdf->cjkfont($cjkname, [%options])
657           Returns a new CJK font object.
658
659           Examples:
660
661               $font = $pdf->cjkfont('korean');
662               $font = $pdf->cjkfont('traditional');
663
664           Valid %options are:
665
666           -encode
667               Changes the encoding of the font from its default.
668
669           See Also: PDF::API2::Resource::CIDFont::CJKFont
670
671       $font = $pdf->synfont($basefont, [%options])
672           Returns a new synthetic font object.
673
674           Examples:
675
676               $cf  = $pdf->corefont('Times-Roman', -encode => 'latin1');
677               $sf  = $pdf->synfont($cf, -slant => 0.85);  # compressed 85%
678               $sfb = $pdf->synfont($cf, -bold => 1);      # embolden by 10em
679               $sfi = $pdf->synfont($cf, -oblique => -12); # italic at -12 degrees
680
681           Valid %options are:
682
683           -slant
684               Slant/expansion factor (0.1-0.9 = slant, 1.1+ = expansion).
685
686           -oblique
687               Italic angle (+/-)
688
689           -bold
690               Emboldening factor (0.1+, bold = 1, heavy = 2, ...)
691
692           -space
693               Additional character spacing in ems (0-1000)
694
695           See Also: PDF::API2::Resource::Font::SynFont
696
697       $font = $pdf->bdfont($bdf_file)
698           Returns a new BDF font object, based on the specified Adobe BDF
699           file.
700
701           See Also: PDF::API2::Resource::Font::BdFont
702
703       $font = $pdf->unifont(@fontspecs, %options)
704           Returns a new uni-font object, based on the specified fonts and
705           options.
706
707           BEWARE: This is not a true pdf-object, but a virtual/abstract font
708           definition!
709
710           See Also: PDF::API2::Resource::UniFont.
711
712           Valid %options are:
713
714           -encode
715               Changes the encoding of the font from its default.
716

IMAGE METHODS

718       $jpeg = $pdf->image_jpeg($file)
719           Imports and returns a new JPEG image object.  $file may be either a
720           filename or a filehandle.
721
722       $tiff = $pdf->image_tiff($file)
723           Imports and returns a new TIFF image object.  $file may be either a
724           filename or a filehandle.
725
726       $pnm = $pdf->image_pnm($file)
727           Imports and returns a new PNM image object.  $file may be either a
728           filename or a filehandle.
729
730       $png = $pdf->image_png($file)
731           Imports and returns a new PNG image object.  $file may be either a
732           filename or a filehandle.
733
734       $gif = $pdf->image_gif($file)
735           Imports and returns a new GIF image object.  $file may be either a
736           filename or a filehandle.
737
738       $gdf = $pdf->image_gd($gd_object, %options)
739           Imports and returns a new image object from GD::Image.
740
741           Options: The only option currently supported is "-lossless => 1".
742

COLORSPACE METHODS

744       $cs = $pdf->colorspace_act($file)
745           Returns a new colorspace object based on an Adobe Color Table file.
746
747           See PDF::API2::Resource::ColorSpace::Indexed::ACTFile for a
748           reference to the file format's specification.
749
750       $cs = $pdf->colorspace_web()
751           Returns a new colorspace-object based on the web color palette.
752
753       $cs = $pdf->colorspace_hue()
754           Returns a new colorspace-object based on the hue color palette.
755
756           See PDF::API2::Resource::ColorSpace::Indexed::Hue for an
757           explanation.
758
759       $cs = $pdf->colorspace_separation($tint, $color)
760           Returns a new separation colorspace object based on the parameters.
761
762           $tint can be any valid ink identifier, including but not limited
763           to: 'Cyan', 'Magenta', 'Yellow', 'Black', 'Red', 'Green', 'Blue' or
764           'Orange'.
765
766           $color must be a valid color specification limited to: '#rrggbb',
767           '!hhssvv', '%ccmmyykk' or a "named color" (rgb).
768
769           The colorspace model will automatically be chosen based on the
770           specified color.
771
772       $cs = $pdf->colorspace_devicen(\@tintCSx, [$samples])
773           Returns a new DeviceN colorspace object based on the parameters.
774
775           Example:
776
777               $cy = $pdf->colorspace_separation('Cyan',    '%f000');
778               $ma = $pdf->colorspace_separation('Magenta', '%0f00');
779               $ye = $pdf->colorspace_separation('Yellow',  '%00f0');
780               $bk = $pdf->colorspace_separation('Black',   '%000f');
781
782               $pms023 = $pdf->colorspace_separation('PANTONE 032CV', '%0ff0');
783
784               $dncs = $pdf->colorspace_devicen( [ $cy,$ma,$ye,$bk,$pms023 ] );
785
786           The colorspace model will automatically be chosen based on the
787           first colorspace specified.
788

BARCODE METHODS

790       $bc = $pdf->xo_codabar(%options)
791       $bc = $pdf->xo_code128(%options)
792       $bc = $pdf->xo_2of5int(%options)
793       $bc = $pdf->xo_3of9(%options)
794       $bc = $pdf->xo_ean13(%options)
795           Creates the specified barcode object as a form XObject.
796

OTHER METHODS

798       $xo = $pdf->xo_form()
799           Returns a new form XObject.
800
801       $egs = $pdf->egstate()
802           Returns a new extended graphics state object.
803
804       $obj = $pdf->pattern()
805           Returns a new pattern object.
806
807       $obj = $pdf->shading()
808           Returns a new shading object.
809
810       $otls = $pdf->outlines()
811           Returns a new or existing outlines object.
812

SUPPORTED PERL VERSIONS

814       PDF::API2 will aim to support all major Perl versions that were
815       released in the past six years, plus one, in order to continue working
816       for the life of most long-term-stable (LTS) server distributions.
817
818       For example, a version of PDF::API2 released on 2018-01-01 would
819       support the last major version of Perl released before 2012-01-01,
820       which happens to be 5.14.
821
822       If you need to use this module on a server with an extremely out-of-
823       date version of Perl, consider using either plenv or Perlbrew to run a
824       newer version of Perl without needing admin privileges.
825

KNOWN ISSUES

827       This module does not work with perl's -l command-line switch.
828

AUTHOR

830       PDF::API2 was originally written by Alfred Reibenschuh, extending code
831       written by Martin Hosken.
832
833       It is currently being maintained and developed by Steve Simms.
834

LICENSE

836       This program is free software: you can redistribute it and/or modify it
837       under the terms of the GNU Lesser General Public License as published
838       by the Free Software Foundation, either version 2.1 of the License, or
839       (at your option) any later version.
840
841       This library is distributed in the hope that it will be useful, but
842       WITHOUT ANY WARRANTY; without even the implied warranty of
843       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
844       Lesser General Public License for more details.
845
846
847
848perl v5.32.0                      2020-07-28                      PDF::API2(3)
Impressum