Wrox Programmer Forums
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 5th, 2007, 12:04 AM
Friend of Wrox
Join Date: Apr 2005
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP to PDF

Hi Everyone !!

I have an ASP page which has a report drawn from values from the database and saved as HTML file and appended to the email sending page. The HTML content is sent to recipients as email attachment. I want the attachment(HTML) to open in PDF format when the recipient gets it. I have used contentType as "application/pdf" and used Stream object to Write Binary data from the HTML content. But that does not work.
The following is the code I have used:

        Response.ContentType = "application/pdf"
    Set objStream = Server.CreateObject("adodb.stream")
    Response.ContentType = "application/pdf"
    objStream.Type = 1
    objStream.Type = adTypeBinary
    objStream.LoadFromFile strPath
    Response.BinaryWrite objStream.Read
    FileName="Temp_" & CStr(Session.SessionId) & "CustomerQuotation" & Fileid & "(" & Session("User") & ").pdf"
    objStream.SaveToFile FileName
    Set objStream = Nothing

where strPath contains the HTML file name and FileName is the converted PDF file .
Any suggestion would be helpful, anyone who has tested this would be most welcome.

Thanks in advance

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP to PDF Bhakti_thakkar Classic ASP Components 5 March 9th, 2007 08:47 AM
Need to Convert ASP to PDF metrov Classic ASP Databases 2 March 9th, 2007 08:10 AM
ASP to PDF rajanikrishna Classic ASP Databases 1 May 5th, 2004 04:36 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.