Ciao a tutti, non riesco ad immettere immagini nei file pdf che creo con la libreria fpdf...Qualcuno può darmi due dritte??
grazie
Ciao a tutti, non riesco ad immettere immagini nei file pdf che creo con la libreria fpdf...Qualcuno può darmi due dritte??
grazie
Da quello che so io, le librerie fpdf di Baol permettono di gestire solo immagini .jpg
Questo è la riga nella libreria fpdf.asp dove viene indicato
Io faccio così:if(xtype=="jpg" || xtype=="jpeg")xinfo=this._parsejpg(xfile);
else this.Error("Unsupported image file type: " + xtype);
Dove per numepage, si intende a quale pagina del file pdf metterò l'immagine
Y=pdf.getY()
if numepage <> pdf.pageNO() then
numepage=pdf.pageNO()
SQLpubb = "SELECT * " _
& "FROM anagpubb where CODI_BOLL_RISU ="&vn_codibollavvi&" and nume_page="& numepage
Set rspubb = cnnSearch.Execute(SQLpubb)
if not rspubb.EOF then
pdf.SetY(Y)
pdf.SetX(X+45)
pdf.Image "pubblicita/file/"&rspubb("DESC_NOME_FILE_rino")&".jpg", X, Y, 0, 50, "JPG"
pdf.Cell 0,50,"",0,1
end if
end if
![]()
scusate ma fpdf fa visualizzare solo un immagine per pagina pdf?![]()
![]()
![]()
uppettone:
code:
help pleasecodice:Set PDF = CreateJsObject("FPDF") pdf.CreatePDF() PDF.SetPath("public/fpdf/") pdf.SetFont "Arial","",16 PDF.Open PDF.SetAuthor "Arredibombaci" PDF.SetCreator "ASP2PDF" PDF.SetKeywords "" PDF.SetSubject "Catalogo" PDF.SetTitle "Catalogo" Dim I, PartenzaY PartenzaY = 40 PDF.AddPage Do While NOT RS.EOF PartenzaY = PartenzaY + 2 if rs("gfoto")<>"" then pdf.sety 0 pdf.Image "/"&RS("gfoto"),pdf.GetY(),partenzaverticale,grandezzafoto end if![]()
Spiega meglio il tuo problema.Originariamente inviato da Lino80
uppettone:
code:
help pleasecodice:Set PDF = CreateJsObject("FPDF") pdf.CreatePDF() PDF.SetPath("public/fpdf/") pdf.SetFont "Arial","",16 PDF.Open PDF.SetAuthor "Arredibombaci" PDF.SetCreator "ASP2PDF" PDF.SetKeywords "" PDF.SetSubject "Catalogo" PDF.SetTitle "Catalogo" Dim I, PartenzaY PartenzaY = 40 PDF.AddPage Do While NOT RS.EOF PartenzaY = PartenzaY + 2 if rs("gfoto")<>"" then pdf.sety 0 pdf.Image "/"&RS("gfoto"),pdf.GetY(),partenzaverticale,grandezzafoto end if![]()
![]()
dovrei stampare in un pdf delle tabelle tipo questa: http://www.emmeci-arredamenti.it/emm...sedute&ok=true
con il seguente codice della pagina stampa_pdf.asp se aggiungo 3 prodotti nel database, ovvero 3 record, il testo me lo visualizza uno sotto l altro separato, mente le 3 immagini me le sovrappone, non me le mette una sotto l altra:
esempio per farti visualizzare le immagini sovrapposte: http://www.sitowebflash.com/public/fpdf/miofile.pdfcodice:<%@language=vbscript%> <% dim rs, sql cont_vero = "true" if stampagiacenza = true then if stampaimmagini = false then SQL = " SELECT * FROM Prodotti WHERE controllostampa = " & cont_vero & " and Gfoto <> '""' order BY " & ordinedistampa Set RS = Conn.Execute(SQL) else SQL = " SELECT * FROM Prodotti WHERE controllostampa = " & cont_vero & " order BY " & ordinedistampa Set RS = Conn.Execute(SQL) end if else if stampaimmagini = false then SQL = " SELECT * FROM Prodotti WHERE controllostampa = " & cont_vero & " and Gfoto <> '""'and (giacenza >0 or giacenzainfinita = true) order BY " & ordinedistampa Set RS = Conn.Execute(SQL) else SQL = " SELECT * FROM Prodotti WHERE controllostampa = " & cont_vero & " and (giacenza >0 or giacenzainfinita = true)order BY " & ordinedistampa Set RS = Conn.Execute(SQL) end if end if Set PDF = CreateJsObject("FPDF") pdf.CreatePDF() PDF.SetPath("public/fpdf/") pdf.SetFont "Arial","",16 PDF.Open PDF.SetAuthor "Arredibombaci" PDF.SetCreator "ASP2PDF" PDF.SetKeywords "" PDF.SetSubject "Catalogo" PDF.SetTitle "Catalogo" Dim I, PartenzaY PartenzaY = 40 PDF.AddPage Do While NOT RS.EOF PartenzaY = PartenzaY + 2 if rs("gfoto")<>"" then pdf.sety 0 pdf.Image "/"&RS("gfoto"),pdf.GetY(),partenzaverticale,grandezzafoto end if PDF.SetXY partenzaid, PartenzaY - 40 PDF.SetFont "", "B", fontgrande PDF.MultiCell 0, 5, RS("id"), 0, 0 , "", 0 PDF.SetFont "", "" PDF.SetXY partenzatesto, PartenzaY - 40 PDF.SetFont "", "B", fontgrande PDF.MultiCell 0, 5, RS("PDescrizione"), 0, 0 , "", 0 PDF.SetFont "", "" PDF.SetXY partenzatesto, PartenzaY -30 PDF.SetFont "", "B", fontmedio PDF.MultiCell 0, 5, RS("Prodotto"), 0, 0 , "", 0 PDF.SetFont "", "" PDF.SetFont "", "", fontpiccolo PDF.SetXY partenzatesto, PartenzaY - 20 PDF.SetFont "", "B", fontpiccolo PDF.MultiCell 0, 5, "Descrizione: ", 0, "", 0 PDF.SetFont "", "" PDF.SetFont "", "", fontpiccolissimo PDF.SetXY partenzatesto, PartenzaY + 4 if RS("GDescrizione") <> null then PDF.MultiCell 0, 8, RS("GDescrizione"), 0, "", 0 PDF.SetFont "", "" end if if stamparprezzo = true then PDF.SetXY partenzatesto + distanzacolonne, PartenzaY -10 PDF.MultiCell 0, 5,"PCD: "& (RS("RPrezzo")), 0, "", 0 end if PDF.SetXY partenzatesto, PartenzaY -10 PDF.MultiCell 0, 5,"Prezzo: "& RS("CPrezzo") &" €", 0, "", 0 PDF.SetXY partenzatesto + distanzacolonne, PartenzaY + 0 PDF.MultiCell 0, 5,"ET: "& RS("PuntiSconto")&" ", 0, "", 0 if stampanote = true then PDF.SetFont "", "", fontpiccolissimo PDF.SetFont "", "" end if PDF.SetXY partenzatesto, PartenzaY + 8 PDF.MultiCell 0, 5, "Giacenza: "& RS("giacenza"), 0, "", 0 PDF.SetXY partenzatesto + distanzacolonne, PartenzaY + 10 PDF.MultiCell 0, 5, "Data: "& strtodata(RS("data")), 0, "", 0 RS.MoveNext Loop 'PDF.Output PDF.Output Server.MapPath("/public/fpdf/miofile.pdf"), true %> PDF generato correttamente, clicca qui per visualizzarlo.
Spero di essermi spiegato meglio, grazie![]()
Sì, ora è più chiaro.
Purtroppo ho un problemino anche io che devo risolvere a breve. Appena posso gli ho una occhiata.
Nel frattempo ti posto il codice che utilizzo per inserire immagini pubblicitarie (estratte da un db) in un file pdf
Spero ti possa dare qualche spunto.
![]()
Y=pdf.getY()
if numepage <> pdf.pageNO() then
numepage=pdf.pageNO()
SQLpubb = "SELECT * " _
& "FROM anagpubb where CODI_BOLL_RISU ="&vn_codibollavvi&" and nume_page="& numepage
Set rspubb = cnnSearch.Execute(SQLpubb)
if not rspubb.EOF then
pdf.SetY(Y)
pdf.SetX(X)
P=0
P=X + cint("0"&rspubb("NUME_POSI_ORIZ"))
l=0
l=0+cint("0"&rspubb("NUME_LUNG_IMAG"))
a=0
a=0+cint("0"&rspubb("NUME_ALTE_IMAG"))
pdf.Image "pubblicita/file/"&rspubb("DESC_NOME_FILE_rino")&".jpg", P, Y, l, a, "JPG"
pdf.SetY(Y)
pdf.SetX(X)
Y=pdf.getY()
X=pdf.getY()
pdf.Cell 0,a,"",0,1
end if
end if
Y=pdf.getY()
ok grazie.. appena finisco di lavorare lo provo![]()