Welcome aboard! We are happy you are here and wish you good net-raft!
<%@ Page Language="VB" %>
<!-- code section -->
<script runat="server">
Imports PdfSharp
Imports PdfSharp.Drawing
Imports PdfSharp.Pdf
Sub request_click(ByVal sender As Object, ByVal e As EventArgs)
Dim pdf As PdfDocument = New PdfDocument
pdf.Info.Title = "My PDF file"
Dim pdfPage As PdfPage = pdf.AddPage
Dim graph As XGraphics = XGraphics.FromPdfPage(pdfPage)
Dim font As XFont = New XFont("Verdana", 15, XFontStyle.Bold)
graph.DrawString("My PDF file", font, XBrushes.Black, _
New XRect(0, 0, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.Center)
Dim pdfFilename As String = "mypdffile.pdf"
pdf.Save(pdfFilename)
Process.Start(pdfFilename)
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<input runat="server" id="button1" type="submit" value="click" OnServerClick="request_click"/>
</form>
</body>
</html>
The most helpful VB.NET solutions
get computer name vb.net VB.NET Click to see more ... 1.1K 76