word file preview on asp.net page - asp.net

is there any way to show a preview content of word file?? like sample application feed viewer? if so please help me?

One approach is:
Convert MS Word file to images. I.e. print first couple of pages to image. This can be done on command line with Open Office or by installing a printer driver that prints to images.
Use these images for preview
Since this takes too much time to be done on-demand, you will have to batch-process all existing documents and schedule processing for new documents as these are added to the system.

Take a look at this article Which describes writing a custom server control that can show word documents in a web page.

Yes there is a way, you can convert Word file to HTML and than display it on your ASP.NET page.

Related

Generate PDF from Gridview in asp.net

I am using 4 gridviews on my page. I need to generate a pdf file which should be accessible on a button click and should contain these 4 grids.
Please help.
We have used WKHTMLTOPDF for our PDF's and it has worked very well. You can use it with a URL which it will then convert to a pdf which can then be sent to the users browser. So you could give it the url of your page with the gridview and then it would return a pdf. There are third party providers that can do the conversion for you, such as PDFCrowd, however this comes at a cost. If I recall correctly they provide a C# wrapper for you to use so it is pretty simple. There is also iText PDF, I have never used it though so cannot comment on it.
Hope this gives you a good start.
You could try with Amyuni WebkitPDF. It is a free tool for HTML to PDF or XAML/XPS convertion. You can pass the URL of the page to the library and obtain a PDF file as result that you can send to the browser.
Usual disclaimer applies.

How Do I convert HTML to PDF with hot links in outputted PDF with ASP(.NET)? Preferably with ActivePDF WebGrabber

My company purchased ActivePDF WebGrabber a couple of years ago to convert a classic ASP created HTML page into a PDF form. The only drawback with the tool that we continually run into is that the outputted HTML links are not hot. Are there any tools that do include hot-links within the HTML to PDF output?
According to the ActivePDF FAQ for Does WebGrabber convert hyperlinks into usable links in the output PDF?, the answer is no. There is a phrase confusing me at the end of the answer:
"To implement links in the final PDF,
the application would search for links
prior to the Postscript generation,
and append them once the PDF has been
generated using Toolkit."
Does that mean this is how to achieve it, or is this their theoretical but not tested solution? If this is the solution, has anyone done this that might be able to post some sample (pseudo-)code?
Edit: I should mention that we're open to a different tool, and we need it to be accessible via classic ASP and ASP.NET. I would prefer a solution in which the links are automatically hot-linked during PDF generation.
Looks like you can do it with the activepdf toolkit after the pdf is generated. I think this is what they are referring to.
Use the AddHyperlink function on the resultant pdf
AddHyperlink instructs Toolkit to add
a hyperlink in the current output file
that connects to a specified URL.
When clicked, the URL opens in a new
browser window.
edit
It would be easier to get a tool that actually does this here are some links
Open Source HTML to PDF Renderer with Full CSS Support
https://stackoverflow.com/questions/3178448/list-of-html-to-pdf-converters
In the old days, activePDF Server was the engine behind activePDF WebGrabber. activePDF Server is a Print-to-PDF program (hence the reference to Postscript) so the links were not live.
Beginning with the WebGrabber 2009 release, the dependancy on Server was removed and WebGrabber will now (versions 2009 & 2010) output intelligent PDFs that include hot-links within the HTML to PDF output.
If you can call into a web service then try the PDF Conversion Services. We are currently looking for beta testers for the html to pdf bit, just drop a line via the contact page.
I know it is an old question, but nowadays it should be sufficient to use
converter.PreserveLinks = true;
Where converter is a WebGrabber instance.

How to preview a word document or PDF using asp.net?

I have a list box that contains a collection of documents that a user has uploaded. I would like to make some sort of preview window on the page that allows the user to see the document without having to download it and open up word or reader. Can this be done?
One word answer: yep
Many words answer: for the PDF viewer, you'll basically need to use a PDF library (ABCPdf, etc) that allows you to generate an image from a PDF on the fly that you send down to the client. For word, there could be similar functionality in VSTO.
Another solution is to use Scribd API to handle all the dirt work for you. That way your users can view their docs in the nice Scribd doc viewer.

Generating PDF documents in ASP.NET [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Directly convert .aspx to .pdf
Is there any way to generate PDF document from asp.net directly from the page output. My requirement is, when user visits a page on my website, there should be a provision to get the same page / report in PDF format. Using iTextSharp, we need to built layout logic agin to generate PDF. If there are any changes in page output in future, I again need to work on logic to generate PDF. Instead I want to generate PDF directly from the page output just by setting "Response.ContentType" property.
One strategy I use is to develop reports using SQL Server Reporting Services. SSRS reports support export to PDF out of the box.
If you use SSRS 2008, you can even assign arbitrary HTML to a text box and the reporting engine will interpret it fairly well. This allows you to retrieve a snippet of HTML from any page, and present it in a report that will export to PDF without having to manually generate PDF document elements with iTextSharp.
If you go the SSRS 2008 route, check out this thread: http://forums.asp.net/t/1443965.aspx
I hope this helps.
Happy Coding!
You can set a button on your page that, if clicked, starts rendering a HTML page to PDF - only that the page you're asking it to render is exactly the page the user has clicked the button on. Once you got the PDF you can just send it in the normal way.
This of course requires a program that can render arbitrary HTML pages to pdf. You might want to check out ABCpdf which has always worked for me like a charm, but it's not free.
http://princexml.com/
They offer an application that converts html to pdf.
We use ActivePDF WebGrabber - which is designed to do exactly what you described. http://www.activepdf.com/products/serverproducts/webgrabber/

ASP.net: Display PDF in a asp.net web page

User click on a link button and it will direct them to a url that is dynmaically generated which a pdf file. The browser will prompt the user to either save or open it.
I want to know if it is possible to downlaod the pdf file to the server then show the pdf file in the asp.net web page. When i google on this question, 99% of top link are some third party component. Is it a way to do this without purchase any 3rd party component?
thank
I use itextsharp, its a free open source c# port of the java itext library.
Makes generating dynamic pdfs in asp.net a breeze and there is lots of documentation/examples floating around.
I don't think that you'll have much luck without a 3rd party component. First, the issue isn't showing the PDF, it is generating it. For that, you'll need a library to help. Rolling one yourself would not be cheaper unless you have an enormous amount of unpaid time on your hands.
With respect to third-party controls, I recommend and use DynamicPDF from CeTe.
Yes there is a way to do this without a 3rd party tool, but it involves coding a PDF-to-html translator.
If this is something for a business, the RoI for the 3rd party control is that you don't have to spend hundreds of hours coding & testing this component, when you could buy one for just a few hundred dollars.
Now, an alternative is to code a page which displays the data in the same way which the PDF file generates it (this could actually be handled by RDLC). So that when the user clicks the link button, they are taken to this display page, from which they can download the PDF version if they want a local copy.
Regardless of how you generate the PDF, I have found a better user experience if you open the PDF in an IFRAME instead of the full browser window. You can give users instructions and maintain the browser navigation.
I think what you want to do is by going to: http://my_site.com/generate-pdf.aspx?=someId
this should in fact just show the PDF file?
What you need to do is change the Response type.
See here for how to do this with images.
Look up the Content-Disposition HTTP header. You can send back a value that requests the content be displayed inline instead of downloaded.

Resources