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