Embed image in word file using ASP - asp-classic

Does any body have any idea how to embed picture in word file created with ASP Classic?

I had to generate Word files with ASP once, by far the easiest way (and you can get it looking pretty good this way) is to render an HTML file with your desired content and do it that way. I can't remember if renaming the HTML file to .doc worked, or if I used a component. But HTML is probably the way to go.

Related

A "shortcut" method for exporting an ASP.Net Page to pdf/xls

I want to export a few Pages to pdf/xls. By Pages I mean as the eye sees it - a screenshot of the Page's contents. I know how to build pdf/xls documents using 3rd party tools but is there any way to quickly export the rendered contents of say a Panel?
edit: maybe a tool that can render the page's output as a browser would, and save it as an image file?
There is an open source console program named wkhtmltopdf which you could call from asp.net to convert the page. It can convert to PDF or an image with wkhtmltoimage (JPG, PNG, etc.) using the webkit rendering engine.
Check my answer to this question to see an example of how to convert from a html to a pdf using C#:
Easiest way of porting html table data to readable document
I can recommend http://www.screengrab.org/ for firefox.

Generate PDF file from HTML string in asp.net with vb

I want to generate PDF file from HTML string and that PDF file I have to attach in mail using asp.net. I try ghtmldoc.exe, it will generate corrupted pdf file.
I also use iTextsharp. It generate PDF without format though I don't use CSS in that HTML page. Only data in html file is converted in PDF.
I've always found Winnovative HTML to PDF converter very useful for doing things like this:
http://www.winnovative-software.com/Html-To-Pdf-Converter.aspx
You can either specify a URL to convert to PDF, or specify a HTML string to convert to PDF instead.
An open source solution, would be iTextSharp:
http://sourceforge.net/projects/itextsharp/
Exporting to pdf is really made simple by telerik. check this link. Telerik has a good look too. so if you are not late to change over to telerik, i suggest do that.

Display Word Document inside ASP.Net page

I want to display a word Document, which is sitting on my IIS. I want to display the whole document as is, inside a iFrame on my aspx page.
I know I can use MS Word Libs, but I cannot install Word on Server where application will be hosted, (Correct me if I am wrong: I cannot use just dlls without installing MS Word on Server).
How can I display the word document in my iFrame?
Probably the easiest way would be to include the Google Docs Viewer.
Other ways could be to use Aspose.Words (commercial) to convert Word to PDF and then use Aspose.Pdf.Kit to convert PDF to images and then display the images online.
PowerTools for Open XML contains an open source, free implementation of a conversion from DOCX to HTML formatted with CSS. The module HtmlConverter.cs supports all paragraph, character, and table styles, fonts and text formatting, numbered and bulleted lists, images, and more. See http://bit.ly/1bclyg9

Multi-lingual static content in ASP.NET

Is there a simple way of making the static content of an .aspx page multi-lingual? Resource files are nice for controls but it's quite hard and annoying to write big chunks of html in them. Any easier ways?
Make properties in resources files and use them, .NET automatically finds the correct resource file, also just make sure so that the property name is same in all the resource files, so it will replace the property value in .aspx page with the value in the resource file.
Don't code html markup in resource file, have the html markup in the .aspx page itself, just get the essential values from resource files.
Just to reiterate what Mahesh said: do NOT put markup in the resource files, just put the static content into them.
If you need to serve different views based on culture, consider doing something else. For example, if you're using MVC you could write a view engine that return the correct markup for each culture.
#ciscoheat what you say is correct, LOCALIZE control is the right thing to use for big chunk of data.

How to display XSL-transformed XML in ASP.NET page?

So far all the XML / XSLT I've worked with takes an XML document and transforms it to a standalone HTML webpage using an XSLT file.
In my web application, I'm using a web service to retrieve the XML document, which I need to render and make human-readable, and then insert that formatted content into a content placeholder in my master page.
The easiest way would be to append the XSLT to the retrieved XML file and link that to the content placeholder, but something tells me I can't just do that.
I took a look at these Stack Overflow pages, but they just want to render the straight XML whereas I want a transformed XML. Also, I need to be able to put it into my master page template.
This article shows how:
http://www.codeproject.com/Articles/37868/Beginners-Introduction-To-XSL-Transform-Rendering-XML-Data-using-XSL-Get-HTML-output.aspx
even if the spelling is as bad as mine...
Added
And here's another link that shows how, perhaps a bit more simply
http://www.aspfree.com/c/a/XML/Applying-XSLT-to-XML-Using-ASP.NET/2/

Resources