jacobgold
Programmer
- May 22, 2012
- 1
hi
i'm working on a website that i allow the user to enter a name and then press a button that prompts the server to setup a pdf acording to the info the user entered and then send the pdf to the user
i'm testing the website on my leptop without iis
i needed the pdf to be hebrew and i didn't found a pdfwrite with vb on hebrew so i write to word and then convert to pdf like the following code
this works fine on firefox chrome safari but on internet explorer the page disconnect before the download it disconnect when the create word statement is executed
can anyone help me with that ?
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim strname As String
strname = TextBox1.Text.Trim
Dim oword As New word.Application
Dim odoc As New word.Document
oword = CreateObject("word.Application")
odoc = oword.Documents.Add("C:\documents\tamp.dotx")
odoc.Bookmarks.Item("name1").Range.Text = strname
odoc.Bookmarks.Item("name2").Range.Text = strname
odoc.Bookmarks.Item("name3").Range.Text = strname
odoc.Bookmarks.Item("name4").Range.Text = strname
odoc.Bookmarks.Item("name5").Range.Text = strname
odoc.Bookmarks.Item("name6").Range.Text = strname
odoc.ExportAsFixedFormat(Server.MapPath("\neshume.pdf"), 17)
Response.Redirect(Server.MapPath("\neshume.pdf"))
i'm working on a website that i allow the user to enter a name and then press a button that prompts the server to setup a pdf acording to the info the user entered and then send the pdf to the user
i'm testing the website on my leptop without iis
i needed the pdf to be hebrew and i didn't found a pdfwrite with vb on hebrew so i write to word and then convert to pdf like the following code
this works fine on firefox chrome safari but on internet explorer the page disconnect before the download it disconnect when the create word statement is executed
can anyone help me with that ?
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim strname As String
strname = TextBox1.Text.Trim
Dim oword As New word.Application
Dim odoc As New word.Document
oword = CreateObject("word.Application")
odoc = oword.Documents.Add("C:\documents\tamp.dotx")
odoc.Bookmarks.Item("name1").Range.Text = strname
odoc.Bookmarks.Item("name2").Range.Text = strname
odoc.Bookmarks.Item("name3").Range.Text = strname
odoc.Bookmarks.Item("name4").Range.Text = strname
odoc.Bookmarks.Item("name5").Range.Text = strname
odoc.Bookmarks.Item("name6").Range.Text = strname
odoc.ExportAsFixedFormat(Server.MapPath("\neshume.pdf"), 17)
Response.Redirect(Server.MapPath("\neshume.pdf"))