Skip to content

Commit a51890f

Browse files
committed
Bugfix for Acrobat Renderer when control is used in other folders than project's root
1 parent 456bcf6 commit a51890f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

WebFormsDocumentViewer.Tests/DocumentViewerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void BuildControl_When_NoErrorsOccur_Then_IFrameIsSetUp()
5959
Width = Unit.Pixel(500),
6060
Height = Unit.Pixel(500)
6161
};
62-
Assert.That(documentViewer.BuildControl("", "").ToString(), Is.EqualTo("<iframe src=sample.pdf width=500px height=500px></iframe>"));
62+
Assert.That(documentViewer.BuildControl("", "").ToString(), Is.EqualTo("<iframe src=/sample.pdf width=500px height=500px></iframe>"));
6363
}
6464

6565
[Test]

WebFormsDocumentViewer/DocumentViewer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ public StringBuilder BuildControl(string projectRootPath, string applicationRoot
110110
if (PdfRenderer == PdfRenderers.PdfJs && !extension.Equals(SupportedExtensions.txt) &&
111111
!extension.ToString().StartsWith("xls"))
112112
FilePath = string.Format("{0}/Scripts/pdf.js/web/viewer.html?file=../../../{1}", applicationRootUrl, FilePath);
113+
else
114+
FilePath = string.Format("{0}/{1}", applicationRootUrl, filePath);
113115

114116
StringBuilder sb = new StringBuilder();
115117
sb.Append("<iframe src=" + FilePath?.ToString() + " ");

WebFormsDocumentViewer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.6.0")]
36-
[assembly: AssemblyFileVersion("1.0.6.0")]
35+
[assembly: AssemblyVersion("1.0.7.0")]
36+
[assembly: AssemblyFileVersion("1.0.7.0")]

0 commit comments

Comments
 (0)