#28412

Thank you for your response.

When I do the same as you guided, I am getting below error


A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 174.143.96.38:80

Public Sub generatePDF(ByVal inputUrl As String, ByVal htmlWidth As Integer, ByVal pageFormat As String, ByVal permissions As Integer, ByVal bookmarks As String, ByVal orientation As String, ByVal insets As String, ByVal fontsDir As String, ByVal outfile As Stream)<br /> <br /> System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")<br /> System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture<br /> <br /> Dim pd4ml As New PD4ML()<br /> If (insets IsNot Nothing) Then<br /> Dim st As Tokenizer = New Tokenizer(insets, ",")<br /> Try<br /> Dim top As Integer = Int32.Parse(st.NextToken())<br /> Dim left As Integer = Int32.Parse(st.NextToken())<br /> Dim bottom As Integer = Int32.Parse(st.NextToken())<br /> Dim right As Integer = Int32.Parse(st.NextToken())<br /> Dim units As String = st.NextToken()<br /> Dim ins As Rectangle = New Rectangle(top, left, bottom, right)<br /> <br /> If ("MM".Equals(units.ToUpper())) Then<br /> pd4ml.PageInsetsMM = (ins)<br /> Else<br /> pd4ml.PageInsets = (ins)<br /> End If<br /> <br /> Catch ex As Exception<br /> Throw New Exception("Invalid page insets (top, left, bottom, right, units): " & insets)<br /> End Try<br /> End If<br /> <br /> pd4ml.HtmlWidth = (htmlWidth)<br /> If (orientation Is Nothing) Then<br /> orientation = "portrait"<br /> End If<br /> <br /> If ("PORTRAIT".Equals(orientation.ToUpper())) Then<br /> pd4ml.PageSize = PD4Constants.getSizeByName(pageFormat)<br /> Else<br /> pd4ml.PageSize = pd4ml.changePageOrientation(PD4Constants.getSizeByName(pageFormat))<br /> End If<br /> <br /> If (permissions <> -1) Then<br /> pd4ml.setPermissions("empty", permissions, True)<br /> End If<br /> <br /> If (bookmarks <> Nothing) Then<br /> If ("ANCHORS".Equals(bookmarks.ToUpper())) Then<br /> pd4ml.generateOutlines(False)<br /> ElseIf ("HEADINGS".Equals(bookmarks.ToUpper())) Then<br /> pd4ml.generateOutlines(True)<br /> End If<br /> End If<br /> <br /> If (fontsDir <> Nothing AndAlso fontsDir.Length > 0) Then<br /> pd4ml.useTTF(fontsDir, True)<br /> End If<br /> <br /> Dim footer As New PD4PageMark()<br /> footer.setPageNumberTemplate("page $[page] of $[total]")<br /> footer.TitleAlignment = PD4PageMark.LEFT_ALIGN<br /> footer.PageNumberAlignment = PD4PageMark.RIGHT_ALIGN<br /> footer.InitialPageNumber = 1<br /> footer.PagesToSkip = 1<br /> footer.FontSize = 14<br /> footer.AreaHeight = 100<br /> pd4ml.PageFooter = footer<br /> <br /> 'pd4ml.render(New Uri(inputUrl), outfile)<br /> 'pd4ml.render(New Uri(inputUrl).AbsoluteUri, outfile)<br /> pd4ml.render(inputUrl, outfile)<br /> <br /> End Sub

I appreciate your further support in this regard.

Thanks
VA