Advertisement

04.18.2008 at 05:28AM PDT, ID: 23333916
[x]
Attachment Details

Using FPDF with ASP wanting to pass variables

Asked by emzi19 in Active Server Pages (ASP), JavaScript

Tags: ASP JAVASCRIPT

Hi,

I am using FPDF with ASP to try and generate a PDF file, but I want the PDF file to generate based on user imput. I've created a separate form that submits to the code below, however when using the normal request.querystring or request.form commands in it it comes up with an error saying request has not been defined. If i change the language to vbscript to request forms seem to work, but then the main PDF code doesnt work.

How then can i pass form variables to use with this script ?

Your help is much appreciated

Many ThanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
</script>
 
 
<body>
 
 
 
<!--#include file="fpdf.asp"-->
 
<%
 
// Creazione dell'oggetto
pdf=new FPDF(); 
 
// Ridefinizione delle funzioni
pdf.Header=function Header()
{
 
    this.Image('flyerbackground.jpg',2,2,206);
    this.SetFont('Arial','B',15);
    this.Cell(1);
   // this.Cell(30,10,'Title',1,0,'C');
    this.Ln(1);
}
 
//pdf.Footer=function Footer()
//{
  //  this.SetY(-15);
    //this.SetFont('Arial','I',8);
    //this.Cell(0,10,'Page '+ this.PageNo()+ '/{nb}',0,0,'C');
//}
 
// Main
pdf.CreatePDF();pdf.SetPath("fpdf/");pdf.Open();
pdf.AddPage();
pdf.SetFont('','',30);
pdf.Cell(85);
pdf.Cell(110,22, title ,0,1,"C");
pdf.SetFont('','',22);
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 1",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 2",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 3",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 4",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 5",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 6",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 7",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 8",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 9",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 10",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 11",0,1,"C");
pdf.Cell(85);
pdf.Cell(110,9,"This is Line 12",0,1,"C");
 
pdf.Image('flyerbackground.jpg',105,200,50);
 
		
pdf.Output();
%>
 
 
 
</body>
</html>
[+][-]04.18.2008 at 06:34AM PDT, ID: 21385566

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 07:11AM PDT, ID: 21385895

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 08:00AM PDT, ID: 21386377

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), JavaScript
Tags: ASP JAVASCRIPT
Sign Up Now!
Solution Provided By: emzi19
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628