How to display the multipage Tiff images over a Web page in ASP.Net?

 Step 1:

Place the Literal control on the web page as mentioned below:

Step 2;

Add the Interop.Tiff2PdfX.dll in the project.

Step 3:

Call the ConvertTiff2PDF(l_strImgSrcPath, l_strImgDestPath) function to convert the single\multipage Tiff image into the PDF as shown below.

Here l_strImgSrcPath will be the source path of the single\multipage Tiff image to be converted.

l_strImgDestPath will be the destination path of the PDF to be generated.

Private Sub ConvertTiff2PDF(ByVal p_strImgSourcePath As String, ByValp_strImgDestPath As String)

Try

‘—    Creates the object.

Dim l_objTiff2Pdf As Tiff2PdfX.CTiff2Pdf

‘—    Intializes the object.

l_objTiff2Pdf = New Tiff2PdfX.CTiff2Pdf

‘—    Calls the function to convert the Tiff to PDF image & Saves the same.

l_objTiff2Pdf.ConvertTiffToPDF(p_strImgSourcePath, p_strImgDestPath)

Catch ex As Exception

‘—    log and raise error code will come here.

Finally

l_objTiff2Pdf = Nothing

End Try

End Sub

Step 4:

Call the DisplayImage() function to display the multipage TIFF image as PDF over the web page by setting the text of the literal control as mentioned below.

Private Sub DisplayImage()

Me. ltrlTiff.Text = “” & _

”     ” & _

”     ” & _

”     ” & _

”     ” & _

”     ” & _

“”

End Sub

Note: ‘ACTUAL FILE PATH’ should be the complete path of the PDF file to be displayed over the web page.

150 150 Burnignorance | Where Minds Meet And Sparks Fly!