ndpace
unread,Nov 10, 2009, 3:56:46 PM11/10/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I am a newbie and inherited this code. Please let me know if there is
needed code missing.
I need to have the FALSE side of this conditional show the PDF without
the watermark, preferably using the same procedure (SendPdfToUser).
Thanks in advance for any help, Jim
If shouldWatermark.Equals("true") Then
Dim pdfDoc As PdfDocument = New PdfDocument(filePath)
Dim newDoc As Byte() = pdfDoc.WatermarkDocument()
Dim pdfFileName As String = filePath.Substring
(filePath.LastIndexOf("\") + 1)
SendPdfToUser(pdfFileName, newDoc)
Else 'no cert
Response.Redirect("./" & path)
End If
*******************************************************************
Private Sub SendPdfToUser(ByVal filename As String, ByVal fileBytes As
Byte())
Context.Response.Clear()
Context.Response.ContentType = "application/pdf"
Context.Response.AppendHeader("content-disposition",
"attachment; filename=" + filename)
Context.Response.BinaryWrite(fileBytes)
Context.Response.Flush()
Context.Response.End()
End Sub