I would imagine you want something like http://dotnetdevelopment.pastebin.com/m273be5a3
On Tue, Nov 10, 2009 at 8:56 PM, ndpace <[email protected]> wrote: > > 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 >
