S
Saravana
I am trying to display a PDF file in a client browser and get garbled
characters. Here is my code and please let me know if I am making any
mistake. The client machine has Adobe ACrobat (Full version installed)
Thanks
<%
dim objFSO, objTS
FileName = "c:\1.pdf"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(FileName)
NameFile=Right(FileName,Len(FileName)-InstrRev(FileName,"\"))
Response.ContentType = "application/pdf"
Response.Buffer = True
Do While Not objTS.AtEndOfStream
strChunk = objTS.Read(32)
strTmp = ""
For i = 1 to Len(strChunk)
strTmp = strTmp & ChrB(Asc(Mid(strChunk, i, 1)))
Next
Response.BinaryWrite strTmp
Response.Flush
Loop
objTS.Close
Set objTS = Nothing
Set objFSO = Nothing
%>
characters. Here is my code and please let me know if I am making any
mistake. The client machine has Adobe ACrobat (Full version installed)
Thanks
<%
dim objFSO, objTS
FileName = "c:\1.pdf"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(FileName)
NameFile=Right(FileName,Len(FileName)-InstrRev(FileName,"\"))
Response.ContentType = "application/pdf"
Response.Buffer = True
Do While Not objTS.AtEndOfStream
strChunk = objTS.Read(32)
strTmp = ""
For i = 1 to Len(strChunk)
strTmp = strTmp & ChrB(Asc(Mid(strChunk, i, 1)))
Next
Response.BinaryWrite strTmp
Response.Flush
Loop
objTS.Close
Set objTS = Nothing
Set objFSO = Nothing
%>