Hey there running Version of pdflib = PDFlib-Lite-7.0.5p3/ so i started to test the pdflib example itself
perl -W hello.pl *** PDFlib context pointer (nil) is invalid *** *** PDFlib context pointer (nil) is invalid *** *** PDFlib context pointer (nil) is invalid *** *** PDFlib context pointer (nil) is invalid *** Use of uninitialized value in die at hello.pl line 19. hello: PDFlib Exception occurred: Missing argument in printf at hello.pl line 44. Error:
is there anything that changes in updated perl versions ?
#!/usr/bin/perl # $Id: hello.pl,v 1.27 2006/10/01 19:55:11 rjs Exp $ # # PDFlib client: hello example in Perl # use pdflib_pl 7.0; $p = PDF_new(); eval { # This means we must check return values of load_font() etc. PDF_set_parameter($p, "errorpolicy", "return"); # This line is required to avoid problems on Japanese systems PDF_set_parameter($p, "hypertextencoding", "winansi"); if (PDF_begin_document($p, "hello.pdf", "") == -1) { die("Error: %s\n", PDF_get_errmsg($p)); } 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_ext($p, 595, 842, ""); $font = PDF_load_font($p, "Helvetica-Bold", "winansi", ""); if ($font == -1) { die("Error: %s\n", PDF_get_errmsg($p)); } PDF_setfont($p, $font, 24.0); PDF_set_text_pos($p, 50, 700); PDF_show($p, "Hello world!"); PDF_continue_text($p, "(says Perl)"); PDF_end_page_ext($p, ""); PDF_end_document($p, ""); }; if ($@) { printf("hello: PDFlib Exception occurred:\n"); printf(" $@\n"); exit; } PDF_delete($p);
one more - Linux only - dance Achim

In reply to Re: PDFlib context pointer (nil) is invalid by Achim
in thread PDFlib context pointer (nil) is invalid by Achim

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.