pdflib on xampp 1.6.7, xp pro

Problems with the Windows version of XAMPP, questions, comments, and anything related.

pdflib on xampp 1.6.7, xp pro

Postby EnglishRocker » 17. September 2008 12:36

Can anyone supply a basic script that produces a pdf, please?
I've looked everywhere but haven't got anything that's worked using pdflib5, which is included in xampp 1.6.7
Thanks.
EnglishRocker
 
Posts: 25
Joined: 12. September 2008 11:07

Postby glitzi85 » 18. September 2008 00:26

User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby EnglishRocker » 18. September 2008 12:11

Thank you, but I've searched for a folder called bind and turned up nothing. I've looked on http://uk2.php.net/manual/en/pdf.examples.php and borrowed the following:
Code: Select all
<?php

try {
    $p = new PDFlib();

    /*  open new PDF file; insert a file name to create the PDF on disk */
    if ($p->begin_document("", "") == 0) {
        die("Error: " . $p->get_errmsg());
    }

    $p->set_info("Creator", "hello.php");
    $p->set_info("Author", "Rainer Schaaf");
    $p->set_info("Title", "Hello world (PHP)!");

    $p->begin_page_ext(595, 842, "");

    $font = $p->load_font("Helvetica-Bold", "winansi", "");

    $p->setfont($font, 24.0);
    $p->set_text_pos(50, 700);
    $p->show("Hello world!");
    $p->continue_text("(says PHP)");
    $p->end_page_ext("");

    $p->end_document("");

    $buf = $p->get_buffer();
    $len = strlen($buf);

    header("Content-type: application/pdf");
    header("Content-Length: $len");
    header("Content-Disposition: inline; filename=hello.pdf");
    print $buf;
}
catch (PDFlibException $e) {
    die("PDFlib exception occurred in hello sample:\n" .
    "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " .
    $e->get_errmsg() . "\n");
}
catch (Exception $e) {
    die($e);
}
$p = 0;
?>


I get this message in firefox3:
Network Timeout

The operation timed out when attempting to contact www.localhost.com.
EnglishRocker
 
Posts: 25
Joined: 12. September 2008 11:07

Postby glitzi85 » 18. September 2008 15:45

Does localhost.com pointing to 127.0.0.1 in your hosts file or in your DNS-Server? If no, then i assume you try to reach http://localhost

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby EnglishRocker » 18. September 2008 23:06

I type http://localhost/multimedia/pdf.php and I get redirected. :?
Love the Butters avatar, Glitzi.
Thanks
EnglishRocker
 
Posts: 25
Joined: 12. September 2008 11:07


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 120 guests