简体   繁体   English

Blazor pdf 从 SQL 服务器读取/查看文件

[英]Blazor pdf File Read/View from SQL Server

I am currently building an application using Blazor with a SQl database.我目前正在使用 Blazor 和 SQl 数据库构建一个应用程序。 The application allows for a user to upload pdf files to the server.该应用程序允许用户将 pdf 个文件上传到服务器。

I've been searching for a simple and efficient way to read/view the pdf files from the SQL server but can not seem to find anything relevant.我一直在寻找一种简单有效的方法来从 SQL 服务器读取/查看 pdf 文件,但似乎找不到任何相关内容。

I would prefer not to use JavaScript like in:https://www.pdftron.com/blog/webviewer/add-webviewer-to-blazor/我宁愿不使用 JavaScript 像:https://www.pdftron.com/blog/webviewer/add-webviewer-to-blazor/

Anyone got a solution to this?有人对此有解决方案吗? Any help or tips would be greatly appreciated.任何帮助或提示将不胜感激。

You could get the pdf as a byte array and render that in iframe. Here is a similar question just the source of data is different.您可以将 pdf 作为字节数组获取并将其呈现在 iframe 中。 这是一个类似的问题,只是数据源不同。 If you store the data as a BLOB in the SQL server you should able to grab the data and convert it to base64.如果您将数据作为 BLOB 存储在 SQL 服务器中,您应该能够获取数据并将其转换为 base64。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM