Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia Document Converter Pro code samples
Example 3: How to convert an URL from ASP  Print Example 
Note: Copy these ASP scripts (main.asp, checkstatus.asp, error.asp and done.asp) into your web site root.

Main.asp
<%
  IF Trim(Request("urlToConvert"))<>"" Then
    Dim DC : Set DC = Server.CreateObject("Neevia.docConverter")

    DC.setParameter "DocumentOutputFormat", "PDF"
    DC.setParameter "DocumentOutputFolder", Server.MapPath(".")
    DC.setParameter "PDFAutoRotatePage", "All"

    Dim docID : docID = DC.GUID & ".url"
    Dim rVal : rVal=DC.submitURL(Trim(Request("urlToConvert")),docID,"")
    Set DC=Nothing
    If rVal<>0 Then Response.Redirect "error.asp"
    Response.Redirect "checkStatus.asp?docID="& docID
  End If
%>
<HTML>
<HEAD>
  <TITLE>Neevia Document Converter Pro sample file</TITLE>
</HEAD>
<BODY><CENTER>
<FORM action="main.asp">
URL to convert:
<INPUT type="input" name="urlToConvert" value="http://neevia.com"><BR>
<INPUT type="submit" name="submit" value="Convert URL">
</FORM>
</BODY>
</HTML>
checkStatus.asp
<%
    Dim DC : Set DC = Server.CreateObject("Neevia.docConverter")

    DC.setParameter "DocumentOutputFormat", "PDF"
    DC.setParameter "DocumentOutputFolder", Server.MapPath(".")

    Dim rVal : rVal=DC.checkStatus(Request("docID"),"")
    Set DC=Nothing

    If rVal=0 Then 
      Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
      Dim docID : docID=fso.GetBaseName(Request("docID"))
      docID=Replace(docID," ","%20")
      Response.Redirect "done.asp?docID="& docID
    End If    

    If rVal<>2 Then Response.Redirect "error.asp"
%>
<HTML>
<HEAD>
 <TITLE>Neevia.com</TITLE>
 <META HTTP-EQUIV="refresh" CONTENT="2">
</HEAD>
<BODY><BR><BR><CENTER>
<H1>CONVERTING - PLEASE WAIT!!!</H1>
</BODY>
</HTML>
error.asp
<HTML>
<BODY><BR><BR><CENTER>
<H1>THERE WAS AN ERROR CONVERTING THE DOCUMENT</H1>
</BODY>
</HTML>
done.asp
<HTML>
<BODY topMargin="0" leftMargin="0" scroll="no">
<EMBED src="<%= Request("docID") & ".pdf"%>" width="100%" height="100%" fullscreen="yes">
</BODY>
</HTML>



Copyright © 1999-2016 Neevia Technology. All Rights Reserved. Home | Products | Technical Support | About Us | Contact Us