creating pdf using pdf_new()

Discussion in 'ASP General' started by Amir, May 16, 2005.

  1. Amir

    Amir Guest

    Hi
    i wrote the following, which causes the script to terminate

    any help is greatly appreciated,

    thanks so much in advance!

    =======================

    <?
    $pdf = pdf_new();
    pdf_open_file($pdf);
    pdf_set_info($pdf, "author", "test auth");
    pdf_set_info($pdf, "title", "test page");
    pdf_set_info($pdf, "creator", "test creator");
    pdf_set_info($pdf, "subject", "Online test");
    pdf_begin_page($pdf, 450, 450);

    $font = pdf_findfont($pdf, "Times-Roman", "winansi",0);

    pdf_setfont($pdf, $font, 12);
    pdf_show_xy($pdf, "test text", 5, 20);

    pdf_end_page($pdf);
    pdf_close($pdf);
    $buffer = pdf_get_buffer($pdf);
    header("Content-type: application/pdf");
    header("Content-Length: ".strlen($buffer));
    header("Content-Disposition: inline; filename=test.pdf");

    echo $buffer;
    pdf_delete($pdf);

    ?>
     
    Amir, May 16, 2005
    #1
    1. Advertising

  2. Amir

    Amir Guest

    sorry
    clicked on wrong group
     
    Amir, May 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vasudevram
    Replies:
    0
    Views:
    566
    vasudevram
    Jul 22, 2006
  2. vasudevram
    Replies:
    0
    Views:
    357
    vasudevram
    Oct 27, 2006
  3. Ricardo Pog
    Replies:
    1
    Views:
    455
    Austin Ziegler
    Mar 26, 2008
  4. Sean Nakasone
    Replies:
    1
    Views:
    400
    Farrel Lifson
    Apr 14, 2008
  5. Jasper2000

    PDF::API2 (Creating PDF files)

    Jasper2000, Mar 11, 2010, in forum: Perl Misc
    Replies:
    1
    Views:
    305
    Jasper2000
    Mar 11, 2010
Loading...

Share This Page