Free Support Forum -

GroupDocs Viewer Search Issues in Image format



We are using Group docs viewer with Image rendering and below config. options.The Search feature that comes up with the Viewer is not working.Let us know if you need additional details
<%= Viewer.ClientCode()
.Watermark(“Client Confidential”,System.Drawing.Color.FromArgb(50,System.Drawing.Color.LightGray),WatermarkPosition.TopRight,90.0f,false)



We are sorry to hear that you have such issue. We have checked your code with our pdf document and the search works well for us as shown on this screenshot (you can see your text and the pdf document with searched word).

Please try to use such option: .SearchForSeparateWords(true)

If this will not help you please share with us example of your document with which the search doesn’t work that we can check it (could be that the issue is document related).

Also in the attachment you will find our example of the pdf - please try search functional with it to insure that it works.

Thank you.


Thanks for the quick turnaround. Unfortunately we are still unable to search the document with the config settings from your email. Please find the attaced CodePage and the documents used for testing the search feature. Let us know if we are missing something.



Thank you for the example. As we know form the live-chat you have this issue with pdf document but as an example you shared the xlsx file. We have checked it and the search works well . Since that please share with us exactly the same pdf document with which the search doesn’t work.

Also we have checked the server side code and found out that you missed (these code lines are commented) the code line which will set the root storage for the Viewer. This step is very important. Please use such code for it: Groupdocs.Web.UI.Viewer.SetRootStoragePath(Server.MapPath("~/testfiles"));

Simply change the folder name.

Thank you.

Thanks for looking into the issue. We are setting the root storage path in global.ascx. My mistake i did not share that file with you.

The other observation is we have build another application using groupDocs and rendered the same file in image format. The search works there. We have issue only with the existing solution.

I have shared all the files of our solution where groupdocs viewer is used. Please check and let us know what could be the issue with this solution.



Thank you for the examples. Since you have several very important libraries and custom classes in your project we definitely need it (also you have promised to share it with us in the live chat).

Also from you code we can see that you use such code:

in the PDFViewer class - please remove these code lines because you have same code in the glabals.

Thank you


As discussed i could not share the solution because of our Organization Security policies.

But we are facing other issues apart from the search functionality.

1. Any file with <span style=“font-size:11.0pt;font-family:“Calibri”,sans-serif;
“Times New Roman”;color:#333300;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>apostrophe (’) in the file name is throwing some error and the error is not logged in the log file as well.

2. While processing some .doc files i am getting below error. The files being confidential i cannot share it with you. But wanted to know why this exception is thrown.

Local time:06/16/2015 13:09:32, UTC time:06/16/2015 13:09:32 Exception
Root Storage Path:
Processing Path:
Local time:06/16/2015 13:09:32, UTC time:06/16/2015 13:09:32 System.InvalidCastException: Unable to cast object of type ‘Aspose.Words.Markup.CustomXmlMarkup’ to type ‘Aspose.Words.Paragraph’.
at Aspose.Words.Document.(Stream , LoadOptions )
at Aspose.Words.Document.(Stream , LoadOptions )
at ..(Stream content)
at ..(Stream content, FileType fileType, Boolean saveTempFile)
at ..(Stream content, DocumentType documentType, String fileName)
at ..(Stream content, String path, FileType targetType)
at ..(String filePath, IFileStorage storage)
at ..(String filePath, Boolean usePdf, Boolean splitPdf, Boolean checkFileDateTime, Boolean isLicensed, Boolean saveToCustomTempStorage, Boolean keepPdfInStream)
at ..(Boolean usePdf, Boolean splitPdf, Boolean checkFileDateTime, Boolean isLicensed, Boolean saveToCustomTempStorage, Boolean keepPdfInStream)
at ...()
at ..(String filePath, options, String outputFolderParam)
at ..(String filePath, options, String outputFolder)
at Groupdocs.Web.UI.Handlers.BaseHandler.(IUrlsCreator urlsCreator, printableHtmlCreator, String guid, Boolean useHtmlBasedEngine, Boolean usePngImagesForHtmlBasedEngine, Nullable1 count, Nullable1 width, Nullable1 quality, Boolean usePdf, Nullable1 preloadPagesCount, Boolean convertWordDocumentsCompletely, String fileDisplayName, String watermarkText, Nullable`1 watermarkColor, WatermarkPosition watermarkPosition, Single watermarkWidth, Boolean ignoreDocumentAbsence, Boolean supportPageRotation, Boolean supportListOfContentControls, Boolean supportListOfBookmarks, Boolean embedImagesIntoHtmlForWordFiles, String callback)
at Groupdocs.Web.UI.Handlers.ViewDocumentHandler.ProcessRequest(HttpContext context)


Hello Njanke,

We are sorry to hear that you have such issue. Please don’t use such symbols in the file names because such symbols are reserved by the web servers and it will be interpreted as an HTML code. To resolve this issue simply remove (’) from the file name.

As for the second issue - looks like in your doc files you have some XML code. Please try to remove such code or try to set .UseHtmlBasedEngine(false) manually.

Thank you.


Thanks for the details. The UseHtmlBasedEngine(false) is already set. Even then we are getting this issue. Is there any other work around for this?


Hi again,

Unfortunately no, since you can’t share the documents we can’t investigate them and fix the issue. The only thing that you can try to do is to convert such documents to the pdf, but I can’t guarantee that this will help.

Thank you.


Hi Team,

I am also facing some issues with the filename of the docs.
The filenames with (’) special characters are unable to open in the viewer.

If windows allows us to save a document with some special character then it should open in the viewer.

We cant rename our files as we have millions of client confidential files which we cannot process and its a impediment for us going forward.

Please revert with a solution ASAP.



Now the search on the document when rendered in image format is working after removing the property setting “//.SupportTextSelection(false)”.

But after removing this property the document loading is very slow. What could be the reason behind this and is there any option to speedup the doc load time?


Hello Nikunj,

Thank you for the question. please don’t confuse the operating system naming convention with Web servers file naming convention. It’s impossible to use such symbols in the file name which will be used for the web. For more information about it please check this article

As a workaround you can try to escape such symbols. For how to do that check this documentation

Thank you.

Hello Njanke,

Thank you for using GroupDocs.Viewer

Could you please follow these methods to increase performance:
1. Try to use HTML-based rendering mode ("UseHtmlBasedEngine(true)" method) if it is suitable for you and there are no document distortions.
2. Use "PreloadPagesCount(1)" method. When using this method GroupDocs.Viewer will begin to load document to the client-side when first page of the document will be converted. When this method is not used, GroupDocs.Viewer converts all pages of a document and only then sends it to the client-side.
3. Use "MinimumImageWidth(value)" method. MinimumImageWidth: if set, the Viewer will load page images with the specified width from the server when starting. It will not load page images from the server again after zooming if the current page image size is smaller than the value specified and if the original (not scaled) page image size is smaller than the value specified. It means that in most cases the GroupDocs.Viewer will load page images only once and will not reload them after zooming in/out.
4. If this is possible for your business-logic, disable thumbnails ("ShowThumbnails(false)").
5. If this is possible for your business-logic, disable ability to select text by using "SupportTextSelection(false)" method.
6. Use "ShowViewerStyleControl(false)" method - it will disable "double page flip" option and will increase performance.

If you will have more questions please feel free to contact us.

Best regards
Evgen Efimov
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+