开发者

Alternatives for server-side PDF viewing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

I'm looking at options for rendering PDFs on the server to avoid the user having to download them (they're big docs) and/or have a PDF reader installed and configured (audience is not tech savvy). The Google Viewer and Scribd are nice examples, but I'm not interested in making the PDFs available on the web (for Google) or storing them on another party's servers (Scribd).

My favorites right now are FlexPaper and PDFWebViewer.NET but I wanted to see if I'm missing any other optio开发者_开发问答ns. Most of the related SO questions on this topic are somewhat dated, so maybe there's something new?

Any other options to check out?


Try Atalasoft ($$)


There's this.

A bit of a mishmash, but it's free and you get to get your hands dirty if you like that sort of thing.


Rendering PDFs on the server is not a very scalable approach. You can do that for a small workgroup, but for a larger group you'd need a lot of hardware and bandwidth. Returning sections of a pdf is much easier as the format is made for that. I think iTextSharp can help.


You can use Aspose.Pdf.Kit for .NET to convert the PDF pages to images and then view those images using any image control. You can use it either with Windows Forms or Web Forms. You can also get complete help using Programmer's Guide, Technical Articles, Videos and Demos. You can also ask any technical questions in the forums.

I'm a member of the Aspose.Pdf.Kit team.


Try RAD PDF ($$)


You may be able to use the ASP.Net ReportViewer control for this purpose. Usually, that control is used for exporting to PDF, but according to this, you can display an existing PDF file in a ReportViewer:

You can render to PDF by calling ReportViewer.LocalReport.Render() and specifying "PDF" for the format. Then this byte stream can be used any way you want in your application.

Here's the code from that discussion. You might find some other useful information there in the comments.

Dim warnings As  Warning() = Nothing
Dim streamids As String() = Nothing
Dim mimeType As String = Nothing
Dim encoding As String = Nothing
Dim extension As String = Nothing
Dim bytes As Byte()

'Get folder on web server from web.config
Dim FolderLocation As String
FolderLocation = System.Configuration.ConfigurationManager.AppSettings("ReportOutputPath")

'First delete existing file
Dim filepath As String = FolderLocation & "PCSummary.PDF"
File.Delete(filepath)

'Then create new pdf file
bytes = ReportViewer1.LocalReport.Render("PDF", Nothing, mimeType, _
    encoding, extension, streamids, warnings)

Dim fs As New FileStream(FolderLocation & "PCSummary.PDF", FileMode.Create)
fs.Write(bytes, 0, bytes.Length)
fs.Close()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜