home *** CD-ROM | disk | FTP | other *** search
Perl Script | 2001-07-04 | 628 b | 30 lines | [TEXT/McPL] |
- #!/usr/bin/perl
- # $Id: hello.pl,v 1.6.2.1 2001/05/16 12:25:50 york Exp $
- #
- # PDFlib client: hello example in Perl
- #
-
- use pdflib_pl 4.0;
-
- $p = PDF_new();
-
- die "Couldn't open PDF file" if (PDF_open_file($p, "hello.pdf") == -1);
-
- PDF_set_info($p, "Creator", "hello.pl");
- PDF_set_info($p, "Author", "Thomas Merz");
- PDF_set_info($p, "Title", "Hello world (Perl)");
-
- PDF_begin_page($p, 595, 842);
- $font = PDF_findfont($p, "Helvetica-Bold", "host", 0);
-
- PDF_setfont($p, $font, 18.0);
-
- PDF_set_text_pos($p, 50, 700);
- PDF_show($p, "Hello world!");
- PDF_continue_text($p, "(says Perl)");
-
- PDF_end_page($p);
- PDF_close($p);
-
- PDF_delete($p);
-