How to view doc file in viewer annotation using vb.net

U send update copy that in viewer the search, do
i downloaded project that u send i run the viewer search not work

image.jpg (86.9 KB)

i change as u tell in reply screenshot are:

image.png (15.2 KB)
image.png (17.7 KB)
image.png (16.2 KB)

how to combine viewer, annotation in same viewer.
image.png (20.4 KB)

@senthilnathan

When rendering to PNG is enabled the search feature is not supported. I have enabled search and rendering to HTML in the application you have shared - web-forms-vb-app-with-search.zip. All the changes were made in the ViewerApiController.vb file. After you run the app you can see the search icon - search.png (61.0 KB).

Regarding your second question, you have already created a separate post - How to combine viewer, annotation in same viewer. Let’s continue the discussion there.

@vladimir.litvinchik

          thanks for reply download and print not work and thumbnail also

@senthilnathan

To enable thumbnails you can set Key .thumbnails = True.
To enable print you have to set Key .print = True and add one more action

        <HttpPost>
        <Route("PrintPdf")>
        Public Function PrintPdf(ByVal request As DocumentDescriptionRequest) As IHttpActionResult
            Dim filePath = Path.Combine(_storagePath, request.Guid)
            Dim loadOptions = New LoadOptions With {
            .Password = request.Password
        }

            Using viewer As Viewer = New Viewer(filePath, loadOptions)
                Dim bytes = GetPdf(viewer)
                Dim fileName = Path.GetFileNameWithoutExtension(request.Guid)

                Dim response = HttpContext.Current.Response

                response.ContentType = "application/pdf"
                response.AddHeader("Content-Disposition", String.Format("attachment; filename={0}", fileName))
                response.BinaryWrite(bytes)
                response.End()
            End Using
        End Function

        Private Function GetPdf(ByVal viewer As Viewer) As Byte()
            Dim memoryStream As MemoryStream = New MemoryStream()
            Dim viewOptions As PdfViewOptions = New PdfViewOptions(Function() memoryStream, Function(stream)
                                                                                            End Function)
            viewer.View(viewOptions)
            Dim bytes As Byte() = memoryStream.ToArray()
            Return bytes
        End Function

Here is the updated version of ViewerApiController.zip (1.9 KB).

@vladimir.litvinchik

thanks for reply download not work

thumbnail has like this

image.png (24.7 KB)

the above image it ok va? for thumbnail

@senthilnathan

To enable download you have to set Key .download = True and add one more action

        <HttpGet>
        <Route("DownloadDocument")>
        Public Function DownloadDocument(ByVal path As String) As IHttpActionResult
            Dim filePath = IO.Path.Combine(_storagePath, path)

            Dim bytes = File.ReadAllBytes(filePath)
            Dim fileName = IO.Path.GetFileName(path)

            Dim response = HttpContext.Current.Response

            response.ContentType = "application/octet-stream"
            response.AddHeader("Content-Disposition", String.Format("attachment; filename={0}", fileName))
            response.BinaryWrite(bytes)
            response.End()
        End Function

We’ll take a look at the issue with thumbnails and update you.

@vladimir.litvinchik

Thanks and update soon thumbnail

@senthilnathan

Sure, we’ll update you when we have any new information.

@senthilnathan

To make thumbnails.png (80.1 KB) work properly try updating ViewerApiController.zip (2.1 KB) or check the complete app - web-forms-vb-app-with-thumbnails.zip.