akaki wrote:not installed the "PDFLib".
Well, there's your problem. If it's not installed then the output is just going to be a "function does not exist" type error message.
Once it is installed there are a couple more issues.
1) Most of the functions you're using are deprecated and should be replaced by their modern equivalents.
2) You never output the PDF you generate. There is no "echo $pdf;" or anything like that at the end.
3) The only thing you do output is a copy of original.pdf.
Is original.pdf readable? Could you attach one of these unreadable PDFs?
To save others having to download the attachments, the Word Document is a screenshot of Acrobat's error dialogue saying that the PDF is unreadable (If you are curious, I've attached the image file itself), and the code is as follows:
<?php
include "connect.inc";
connect();
// We'll be outputting a PDF
header('Content-type: application/pdf');
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');
// The PDF source is in original.pdf
readfile('original.pdf');
$pdf = pdf_new();
pdf_open_file($pdf, "C:\wamp\www\magnusts\totalorders.pdf");
pdf_set_info($pdf, "Author", "Ben Shepherd");
pdf_set_info($pdf, "Title", "Creating a pdf");
pdf_set_info($pdf, "Creator", "Ben Shepherd");
pdf_set_info($pdf, "Subject", "Creating a pdf");
pdf_begin_page($pdf, 595, 842);
$arial = pdf_findfont($pdf, "Arial", "host", 1);
pdf_setfont($pdf, $arial, 14);
pdf_show_xy($pdf, "<Type your info here>",50, 400);
$gif_image = pdf_open_gif($pdf, "baseball.gif");
pdf_place_image($pdf, $gif_image, 200, 300, 1.0);
pdf_close_image($pdf, $gif_image);
pdf_end_page($pdf);
pdf_close($pdf);
?>