使用此部分,我可以轻松呈现任何文件:
LinkButton lb = sender as LinkButton;
string script = String.Format("Sys.Application.add_load(function() {{
openWindow($get('{0}')); }});", lb.ClientID); ;
lb.ToolTip = "pdf.js/web/viewer.html?file=kit.pdf";
ScriptManager.RegisterStartupScript(this, this.GetType(), "openPdfFile",
script, true);
我从数据库中获取base64
并可以将其进一步转换为byte[]
或其他任何内容。但是如何将'pdf.js/web/viewer.html?file='
字符串传递给JavaScript
字符串而不使用uint8array
,atob
等<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-Xlint:-processing</arg>
</compilerArgs>
</configuration>
</plugin>
转换(并且不保存)