aspeasypdf and asp page

All questions that are not covered on the aspEasy section and concerns on MITData company

aspeasypdf and asp page

Postby ppalandj on Wed Mar 29, 2006 3:30 pm

please, I am just testing the possibility to generate a PDF file from a ASP page directly. same like for a HTML page but it's not working.

Is ther a possibility for this ?

to write instead of:
FileName = Server.MapPath("RETRIEVE_template.htm")
to write
FileName = Server.MapPath("RETRIEVE_template.asp")

the isuue it that the html page is generated by the ASP page and the html page is only on the client page....


thank you of your response...
regards
ppalandj
 
Posts: 4
Joined: Wed Mar 29, 2006 3:17 pm

Postby John on Wed Mar 29, 2006 6:59 pm

If you use Server.MapPath to retrieve the file then you will retrieve the physical file and it will not process the contents of the .ASP page.
For an ASP page you need to retrieve it with the AddHTML command and using the http:// tag to specify that the file should be process by the IIS and the forward it to aspEasyPDF:

PDF.AddHTML ("http://127.0.0.1/RETRIEVE_template.asp")
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

Postby ppalandj on Thu Mar 30, 2006 12:27 pm

Thank for the response.

now I use the good syntax but I have an error:
HTTP 401.2 - Unauthorized: Logon
failed due to server configuration
Internet Information Services
Technical Information (for support personnel)
• Background:
This is usually caused by a server-side script not sending the proper
WWW-Authenticate header field. Using Active Server Pages scripting this is done
by using the AddHeader method of the Response object to request

How I can configure the IIS server for the autorisation ?


Regards
ppalandj
 
Posts: 4
Joined: Wed Mar 29, 2006 3:17 pm

Postby ppalandj on Thu Mar 30, 2006 3:16 pm

I have seen on the microsoft web site how to configure the IIS:

On the Directory Security tab, under Anonymous access and authentication control, click Edit.
Select (and implement) at least one type of authentication method.


But with this, I don't have the error but in this case the PDF generated is blank ? any idea ?


I use the link:
http://localhost/pdfsamples/pdf_html_version.asp

in the pdf_html_version.asp file I have the line:
PDF.AddHtml( "http://localhost/pdfsamples/ajoute_employes.asp" )

Of course if I use the direct link http://localhost/pdfsamples/ajoute_employes.asp
I have a good generation of the HTML file with all the data on the screen...




total code in my pdf_html_version.asp file:
<%

Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.ContentType = "application/pdf"

dim PDF

set PDF = server.createobject("aspPDF.EasyPDF")

PDF.License("EasyPDF.lic")
PDF.SetMargins 20,20,20,20
PDF.AddHtml( "http://localhost/pdfsamples/ajoute_employes.asp" )
PDF.BinaryWrite

set pdf = nothing
%>
ppalandj
 
Posts: 4
Joined: Wed Mar 29, 2006 3:17 pm

Postby John on Thu Mar 30, 2006 6:14 pm

Set the debug property to true to see what's happening, it will show you the correct error.

Check also IIS logs and be sure to use the latest version available.
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

The exact same problem.

Postby MatsJakobsson on Fri Mar 31, 2006 2:39 pm

Hi,

I am experiencing the exact same problem. The only message I get when setting the debug property to true is:

ERROR on AddHTML with Code : 0

My code:

Response.Buffer = TRUE
Response.ContentType = "application/pdf"

dim PDF

set PDF = server.createobject("aspPDF.EasyPDF")
PDF.DEBUG = true

PDF.License("EasyPDF.lic")

' Set margins for the page
PDF.SetMargins 40,40,40,40

PDF.AddHtml("http://localhost/energianalysWeb/override/pdfasp_report.asp")
PDF.BinaryWrite
set pdf = nothing

Regards
MatsJakobsson
 
Posts: 9
Joined: Fri Mar 31, 2006 2:35 pm

Postby ppalandj on Fri Mar 31, 2006 5:52 pm

Ok now I can generate some pdf if the asp generate classic data like a response from a sql request. but my issue is that my asp page include some java plugin (in fact it's for a chemistry application , so I need to see chemical compound included in the plugin...)
If I print my page from the Internet explorer to a pdf writer it's OK, but threw the aspesasypdf, I am not sure that it's possible.

Could you confirm that it's possible to print in fact all the content of a html page with the visualisation of some plugin exactly like the print function to a virtual PDF printer with aspeasyPDF?

regards
ppalandj
 
Posts: 4
Joined: Wed Mar 29, 2006 3:17 pm

Postby John on Fri Mar 31, 2006 8:14 pm

If the page has a JAVA plugin which displays results then you won't be able to see it on your PDF document as aspEasyPDF does not support JAVA applets.

If you can generate and image from the JAVA applet, save it in a JPG format, then you may be able to load it as an image in the PDF. But you need to check if your applet allows you to do that.
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

Postby John on Fri Mar 31, 2006 8:15 pm

I am experiencing the exact same problem. The only message I get when setting the debug property to true is:

ERROR on AddHTML with Code : 0


On the IIS log which errors displays?
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

IIS error report

Postby MatsJakobsson on Sat Apr 01, 2006 5:19 pm

This is what the IIS log looks like:

2006-04-01 15:14:45 127.0.0.1 - W3SVC1 MONKEY 127.0.0.1 80 GET /energianalysWeb/pdfreport.asp - 200 0 2661 501 1162 HTTP/1.1 localhost Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+iOpus-I-M;+.NET+CLR+1.1.4322;+InfoPath.1;+.NET+CLR+2.0.50727) ASPSESSIONIDACABTBAD=PDCDACDDKCHGNEGNKCGDAAAE -

2006-04-01 15:14:45 127.0.0.1 - W3SVC1 MONKEY 127.0.0.1 80 GET /energianalysWeb/override/pdfasp_report.asp - 200 0 1617 155 671 HTTP/1.0 localhost aspEasyPDF+3.30ß - -

Where the first call is to the generating page with aspEasyPdf code in it and the second the asp page from which I am trying to generate the pdf.

When I do not run in debug mode the pdf comes up as it should, but it is completely empty.

Regards
MatsJakobsson
 
Posts: 9
Joined: Fri Mar 31, 2006 2:35 pm

solved it.

Postby MatsJakobsson on Sun Apr 02, 2006 6:15 pm

Thanks for taking your time with my questions, but I solved it. I dunno how it works behind the scenes but setting the "application protection" on the IIS to "low (IIS process)" solved it. Not sure what implications this will lead to securitywise, but you probably have some ideas?

Thanks,
Mats J
MatsJakobsson
 
Posts: 9
Joined: Fri Mar 31, 2006 2:35 pm

Still having problem.

Postby MatsJakobsson on Tue Apr 04, 2006 2:49 pm

Hi,

Thought I solved it, but I still have the same problem.

This is now my code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<%
dim PDF, FileName
set PDF = server.createobject("aspPDF.EasyPDF")

FileName = "pdf_test.pdf"
PDF.Debug = True
PDF.addhtml("http://127.0.0.1/energianalysWeb/override/pdf_report.asp")
PDF.Save Server.MapPath(FileName)
Response.write "<a href="""&FileName&""">See PDF file</a>"
set pdf = nothing
%>
</body>
</html>

Where pdf_report.asp consist of:

<%response.ContentType="text/HTML"%>
<html>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF">
<table>
<tr><td>testing</td></tr>
</table>
</body>
</html>

And I get the following:

aspEasyPDF 3.30ß DBG: DEBUGGING ON
aspEasyPDF 3.30ß DBG: VER$; aspEasyPDF 3.30ß (D7) (easyReportPDF 1.06) Shareware (TCP/IP:192.168.1.2 ID:256.667.827.4)
aspEasyPDF 3.30ß DBG: AddHTML ( "http://127.0.0.1/energianalysWeb/override/pdf_report.asp" )
aspEasyPDF 3.30ß DBG: ERROR on AddHTML with Code : 0
aspEasyPDF 3.30ß DBG: SAVE [c:\inetpub\wwwroot\energianalysWeb\pdf_test.pdf]
aspEasyPDF 3.30ß DBG: SAVE DONE!
See PDF file aspEasyPDF 3.30ß DBG: (OnEndPage) End and free memory

My IIS log says:

2006-04-04 12:42:20 127.0.0.1 - W3SVC1 MONKEY 127.0.0.1 80 GET /energianalysWeb/pdfreport.asp - 200 0 1467 340 621 HTTP/1.1 localhost Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+iOpus-I-M;+.NET+CLR+1.1.4322;+InfoPath.1;+.NET+CLR+2.0.50727) ASPSESSIONIDAQASCRQQ=DHAMCJBBEAGGLIDBNMPFPDBC -
2006-04-04 12:42:20 127.0.0.1 - W3SVC1 MONKEY 127.0.0.1 80 GET /energianalysWeb/override/pdf_report.asp - 200 0 1602 152 591 HTTP/1.0 127.0.0.1 aspEasyPDF+3.30ß - -

What I find a bit strange is that aspEasyPDF uses http/1.0, should it be that way?

I have tried a number of settings in IIS, I have changed permissions so more or less everyone has "full control", tried to set application protection to low and more...

Please does anyone have any idea? I really need to get this working with the dynamics of asp. I have no trouble at all generating a pdf from pure html, but when it comes to asp it is hopeless.

Thanks,
Mats J
MatsJakobsson
 
Posts: 9
Joined: Fri Mar 31, 2006 2:35 pm

Postby John on Tue Apr 04, 2006 9:19 pm

Can you try this version;

http://www.mitdata.net/files/easypdf_331d_D7.zip

I will check also why is getting the HTTP1.0 header.
John Lohmeyer
MITData, S.C.P
John
 
Posts: 1313
Joined: Wed Oct 31, 2001 10:23 am
Location: Spain

New error code.

Postby MatsJakobsson on Wed Apr 05, 2006 11:25 am

Hi,

Thanks for your reply!

Unfortunately the new version did not resolve my problem, but I got a couple of changes in the error report from aspEasypdf and in the iis log:

aspEasyPDF 3.31d DBG: DEBUGGING ON
aspEasyPDF 3.31d DBG: VER$; aspEasyPDF 3.31d (D7) Shareware (TCP/IP:192.168.1.2 ID:256.667.827.4)
aspEasyPDF 3.31d DBG: AddHTML ( "http://localhost/energianalysWeb/pdf_report.asp" )
aspEasyPDF 3.31d DBG: ERROR on AddHTML with Code : -1
aspEasyPDF 3.31d DBG: SAVE [c:\inetpub\wwwroot\energianalysWeb\pdf_test.pdf]
aspEasyPDF 3.31d DBG: SAVE DONE!
See PDF file aspEasyPDF 3.31d DBG: (OnEndPage) End and free memory

IIS log (HTTP/1.1 is now used):

2006-04-05 08:45:09 127.0.0.1 - W3SVC1 MONKEY 127.0.0.1 80 GET /energianalysWeb/pdfreport.asp - 200 0 1440 340 103609 HTTP/1.1 localhost Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+iOpus-I-M;+.NET+CLR+1.1.4322;+InfoPath.1;+.NET+CLR+2.0.50727) ASPSESSIONIDAQASCRQQ=BLAMCJBBBFOJBEDJAFLPLABO -
2006-04-05 08:45:09 127.0.0.1 - W3SVC1 MONKEY 127.0.0.1 80 GET /energianalysWeb/pdf_report.asp - 200 0 269 127 60096 HTTP/1.1 localhost aspEasyPDF+3.31d - -

Any ideas?

Thanks,
Mats J
MatsJakobsson
 
Posts: 9
Joined: Fri Mar 31, 2006 2:35 pm

one more thing...

Postby MatsJakobsson on Wed Apr 05, 2006 11:28 am

... forgot to say, it takes a tremendous amount of time before addhtml returns the error code, that is the page stops after displaying the three first rows - at first I thought it hang, but it didn't. This is also different from the previous version.

Thanks.
MatsJakobsson
 
Posts: 9
Joined: Fri Mar 31, 2006 2:35 pm

Next

Return to General questions

Who is online

Users browsing this forum: No registered users and 3 guests

cron

Fatal error: Not able to open ./cache/data_global.php in D:\Hosting\6480136\html\ForosBB3\includes\acm\acm_file.php on line 106