problemas con imagen en FPDF
Publicado por edulaencina (1 intervención) el 12/08/2007 12:25:30
pongo el codigo como dice en un tutorial pero no me funciona
<%@language=javascript%>
<!--#include file="fpdf.asp"-->
<%
pdf=new FPDF();
pdf.Header=function Header()
{
this.Image('camion.jpg',10,8,33);
this.SetFont('Helvetica','B',15);
this.Cell(80);
this.Cell(30,10,'Title',1,0,'C');
this.Ln(20);
}
pdf.Footer=function Footer()
{
this.SetY(-15);
this.SetFont('Arial','I',8);
this.Cell(0,10,'Pagina '+ this.PageNo()+ '/{nb}',0,0,'C');
}
// Main
pdf.CreatePDF();
pdf.SetPath("fpdf/");
pdf.Open();
pdf.AddPage();
pdf.SetFont('Times','',36);
//for(i=1;i<=40;i++)
pdf.Cell(0,10,'multitrucks.com',0,1,'C');
pdf.Output();
%>
Ya he probado a poner formato .png. donde hay que dejar las imagenes.
Me sale el error: EL ARCHIVO NO INICIA CON %PDF. pero si elimino la linea de la insercion de imagen va bien.
Saludos
<%@language=javascript%>
<!--#include file="fpdf.asp"-->
<%
pdf=new FPDF();
pdf.Header=function Header()
{
this.Image('camion.jpg',10,8,33);
this.SetFont('Helvetica','B',15);
this.Cell(80);
this.Cell(30,10,'Title',1,0,'C');
this.Ln(20);
}
pdf.Footer=function Footer()
{
this.SetY(-15);
this.SetFont('Arial','I',8);
this.Cell(0,10,'Pagina '+ this.PageNo()+ '/{nb}',0,0,'C');
}
// Main
pdf.CreatePDF();
pdf.SetPath("fpdf/");
pdf.Open();
pdf.AddPage();
pdf.SetFont('Times','',36);
//for(i=1;i<=40;i++)
pdf.Cell(0,10,'multitrucks.com',0,1,'C');
pdf.Output();
%>
Ya he probado a poner formato .png. donde hay que dejar las imagenes.
Me sale el error: EL ARCHIVO NO INICIA CON %PDF. pero si elimino la linea de la insercion de imagen va bien.
Saludos
Valora esta pregunta


0