Results 1 to 7 of 7

Thread: output webpage in pdf foramt using asp3.0

  1. #1
    Join Date
    Jul 2004
    Posts
    153
    Rep Power
    0

    Default output webpage in pdf foramt using asp3.0

    i need to output a webpage in pdf format... is there any com object i can use to do this.

    Things i already know:
    *pdf files are binary files. Therefor i could use the appropriate content type with a response.binarywrite "binarystring"
    using a XSL stylesheet.

    *------------------------my sample. for some reason this does not work
    Code:
    Set objXMLHTTP= Server.CreateObject("Microsoft.XMLHTTP")
    	
      objXMLHTTP.Open "GET", "http://localhost/siteroot/page.html", False
    
      objXMLHTTP.Send
      Response.AddHeader "Pragma", "no-cache"	
       Response.ContentType = "application/pdf"
       Response.BinaryWrite objXMLHTTP.responseBody
    
      Set xml = Nothing
    *---------------------------------------------------------
    i used the following com object: Microsoft.XMLHTTP to generate the binarystring and not XSL.

    the output is gen. but its not pdf format.
    need suggession/solution ASAP.

  2. #2
    Join Date
    Jan 2006
    Posts
    18
    Rep Power
    0

    Default

    I think you will need to create a COM Component to change the text/html data to .pdf as the Microsoft.XMLHTTP only fetches the data and writes it back in the mime type of the original data

    Simply changing the mime type and telling the COM object that is was binary it fetched will not work.

    when you get the answer give me the link-up ... ok.

  3. #3
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default

    I also belive that you shouldnt send "Pragma: no-cache" in the headers, because IE uses the cache to display a pdf, even if you sending the right binary data, it wouldnt show up, because the cache would be wiped, however ive noticed that "Pragma:no-cache" doesnt seem to work half the time. But y then are you sending it?

  4. #4
    Join Date
    Feb 2005
    Posts
    73
    Rep Power
    0

    Default Slightly OT

    Sorry for straying slightly off topic, but I don't get why pdf is so popular. What does it do so well that HTML doesn't do. I have really disliked acrobat reader for at least 7 years and thought it would die out quickly then, but it is getting more and more popular. I don't understand. The only think I can kind of see is that it makes it slightly easier to print exactly as the designer wants instead of as the user wants, but only slightly. Am I missing something?!??

  5. #5
    Join Date
    Mar 2004
    Posts
    123
    Rep Power
    0

    Default

    Was searching the net and came up on these site: http://www.antennahouse.com/product/.../pdfoutput.htm and http://dypso.free.fr/tech/generer_pd...rs_html-en.php Hope they are of some help to you.
    There is no wrong or right, only consequencies to action

    "It is the duty of man to make his knowledge so complete in life, so as to make it impossible for any other to take advantage of him" - Marcus Garvey

  6. #6
    Join Date
    Sep 2004
    Posts
    356
    Rep Power
    0

    Default

    check out
    http://www.websupergoo.com/abcpdf-1.htm
    they have a component you could use

    I use to be a big ASP fan but since I got converted to PHP there is no looking back
    you need to join the world of Open Source ok man everything is free even the component /function

  7. #7
    Join Date
    Jan 2006
    Posts
    18
    Rep Power
    0

    Default

    dont know why ppl think that ASP is not open source ... Please stop trying to convert ... n do your thing.. look at DotNetNuke and there are more open source projects in .cfm and .asp(x) combined than there are on .php . there is a time and place for everything.

    man

    so sick of this preaching and the division !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •