codice:
<?php
$pagwidth=595;
$pagheight=842;
$myPDF=pdf_new();
pdf_open_file($myPDF,"pdf/primo.pdf");
pdf_begin_page($myPDF,$pagwidth,$pagheight);
pdf_end_page($myPDF);
pdf_close($myPDF);
?>
<a href ="pdf/primo.pdf">visualizza il pdf </a>
errore
Fatal error: PDFlib error: [2100] PDF_begin_page: Function must not be called in 'object' scope in C:\WM\www\esempi\PDF1.php on line 7
se al posto di pdf/primo.pdf scrivo primo.pdf lo script funziona ma NON CREA NESSUN FILE.(premetto che la cartella pdf esiste!)
se scrivo quest'altro codice
codice:
<?php
$pagwidth=595;
$pagheight=842;
$myPDF=pdf_new();
pdf_open_file($myPDF,"primo.pdf");
pdf_begin_page($myPDF,$pagwidth,$pagheight);
$arial=pdf_findfont($myPDF,"Arial","host",1);
pdf_set_font($myPDF,$arial,12);
pdf_show_xy($myPDF,"benvenuti in pdf",70,700);
pdf_end_page($myPDF);
pdf_close($myPDF);
?>
<a href ="primo.pdf">visualizza il pdf </a>
tipo di errore..
Fatal error: PDFlib error: [2516] PDF_findfont: Metrics data for font 'Arial' not found in C:\WM\www\esempi\PDF1.php on line 9