Guest User

Untitled

a guest
Aug 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. File does not begin with '%PDF-' when including image using FPDF in Classic ASP
  2. this.Image('bg_logo_small.jpg',10,8,213,46);
  3.  
  4. ./rpt/report.asp
  5. ./rpt/fpdf.asp
  6. ./rpt/bg_logo_small.jpg
  7.  
  8. ./rpt/fpdf/ - this directory contains all the files extracted from fpdf1.01.zip
  9. ./rpt/fpdf/extends/
  10. ./rpt/fpdf/fonts/
  11. ./rpt/fpdf/includes/
  12. ./rpt/fpdf/models/
  13.  
  14. <%@LANGUAGE="javascript" CODEPAGE="65001"%>
  15. <!--#include file="fpdf.asp" -->
  16. <%
  17. var pdf=new FPDF();
  18.  
  19. pdf.Header=function Header()
  20. {
  21. this.Image('bg_logo_small.jpg',10,8,213,46);
  22. this.SetFont('Arial','B',15);
  23. this.Cell(80);
  24. this.Cell(30,10,'Title',1,0,'C');
  25. this.Ln(20);
  26. }
  27.  
  28. pdf.Footer=function Footer()
  29. {
  30. this.SetY(-15);
  31. this.SetFont('Arial','I',8);
  32. this.Cell(0,10,'Page '+ this.PageNo()+ '/{nb}',0,0,'C');
  33. }
  34.  
  35. pdf.CreatePDF();
  36. pdf.SetPath("fpdf/");
  37. pdf.SetFont("Arial","",16);
  38. pdf.Open();
  39. pdf.AddPage();
  40. pdf.Cell(40,10,"Hello Word!");
  41. pdf.Close();
  42. pdf.Output();
  43. %>
  44.  
  45. pdf.LoadModels("bgimg")
  46.  
  47. ./rpt/fpdf/models/
  48.  
  49. try with <%@LANGUAGE="javascript" %>
  50.  
  51. insted of <%@LANGUAGE="javascript" CODEPAGE="65001"%>
  52.  
  53. Just need to remove CODEPAGE="65001"
Add Comment
Please, Sign In to add comment