This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
02 - Web UI Template/CognitiveSearch.UI/wwwroot Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ pre {
402402}
403403
404404.results-div {
405- width : 100 % ;
405+ width : 50 % ;
406406}
407407
408408.results-body {
Original file line number Diff line number Diff line change @@ -178,10 +178,12 @@ function GetFileHTML(data, result) {
178178 var pathLower = path . toLowerCase ( ) ;
179179
180180 if ( pathLower . includes ( ".pdf" ) ) {
181- var expectedType = encodeURIComponent ( "application/pdf" ) ;
182- var encodedFilename = encodeURIComponent ( filename ) ;
183- var previewPath = `/preview/${ data . storageIndex } /${ encodedFilename } /${ expectedType } ` ;
184- fileContainerHTML = `<iframe class="file-container" src="${ previewPath } "><p>Your browser does not support iframes.</p></iframe>` ;
181+ fileContainerHTML =
182+ `<object class="file-container" data="${ path } " type="application/pdf">
183+ <iframe class="file-container" src="${ path } " type="application/pdf">
184+ This browser does not support PDFs. Please download the XML to view it: <a href="${ path } ">Download PDF</a>"
185+ </iframe>
186+ </object>` ;
185187 }
186188 else if ( pathLower . includes ( ".txt" ) || pathLower . includes ( ".json" ) ) {
187189 var txtHtml = htmlDecode ( result . content . trim ( ) ) ;
You can’t perform that action at this time.
0 commit comments