home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 February / PCWorld_2002-02_cd.bin / Software / Vyzkuste / pdflib / pdflib-4.0.1.sit / pdflib-4.0.1 / bind / perl / hello.pl next >
Encoding:
Perl Script  |  2001-07-04  |  628 b   |  30 lines  |  [TEXT/McPL]

  1. #!/usr/bin/perl
  2. # $Id: hello.pl,v 1.6.2.1 2001/05/16 12:25:50 york Exp $
  3. #
  4. # PDFlib client: hello example in Perl
  5. #
  6.  
  7. use pdflib_pl 4.0;
  8.  
  9. $p = PDF_new();
  10.  
  11. die "Couldn't open PDF file" if (PDF_open_file($p, "hello.pdf") == -1);
  12.  
  13. PDF_set_info($p, "Creator", "hello.pl");
  14. PDF_set_info($p, "Author", "Thomas Merz");
  15. PDF_set_info($p, "Title", "Hello world (Perl)");
  16.  
  17. PDF_begin_page($p, 595, 842);
  18. $font = PDF_findfont($p, "Helvetica-Bold", "host", 0);
  19.  
  20. PDF_setfont($p, $font, 18.0);
  21.  
  22. PDF_set_text_pos($p, 50, 700);
  23. PDF_show($p, "Hello world!");
  24. PDF_continue_text($p, "(says Perl)");
  25.  
  26. PDF_end_page($p);
  27. PDF_close($p);
  28.  
  29. PDF_delete($p);
  30.