Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 25d6020

Browse files
fixing bug in rendering pdfs; reverting to two columns
1 parent 213a6a7 commit 25d6020

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

02 - Web UI Template/CognitiveSearch.UI/wwwroot/css/site.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ pre {
402402
}
403403

404404
.results-div {
405-
width: 100%;
405+
width: 50%;
406406
}
407407

408408
.results-body {

02 - Web UI Template/CognitiveSearch.UI/wwwroot/js/details.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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());

0 commit comments

Comments
 (0)