Any way to save a graph as PDF using FusionCharts 3.1 inside a Windows Service? - asp.net

I'm working on an asp.net website that uses FusionCharts v3.1 code to render graphs as swf files.
I need to write code to allow users to re-create and email these graphs on a scheduled basis. Our product uses a service to take care of scheduling and email events so I need to modify the code to first render the data as a graph, save it as a PDF, then attach it to the email body. All this must be done in the service so no UI will be available.
Anyone know if IE can be loaded and display a shockwave object if there's no UI available?

This is Subhayu from the FusionCharts team. Maybe I can offer you some help. :)
Saving the charts as PDF files is as easy as cake. Check out the following link for detailed steps on how to export the charts as PDF and save it directly to the specified location.
Go to www.fusioncharts.com/docs. Using the nav bar on the left go to Exporting as Image/PDF > Server-side Exporting.
For your second query on how to just create the chart image without using any interface(without rendering it to the client side), we have a demo on how to do exactly this in .NET 2.0. Please provide your e-mail id on this post so that we can provide this demo to you. Or you can optionally send a request to support[at]fusioncharts.com.
Hope this helps. :)

Related

word file preview on asp.net page

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.

Create dynamic PDF in Flex

Trying to understand from a high-level how this would be accomplished.
Use case:
Flash application embedded in HTML used to create Certificates (just an example).
User enters a bunch of data into a form (Name, Address, What certificate is for, etc.).
User clicks a button which causes the application to create a Certificate in PDF form, with the form data displayed in a format that I define with a bunch of different images).
Ideally, Flex could use the browsers functionality to prompt the user with "What would you like to do with this document, 'Download', 'Open'. So it would function just like clicking on a link to a PDF document inside of a web page.
I already have the form and everything, its just a matter of how I create a PDF from that data. Is there a certain function that can take the current screen and create a PDF image of it? Or is there a certain library for creating PDFs? If anyone can point me in the right direction it would be much appreciated.
There is a AS3 PDF generator library called AlivePDF and can be found here.
Purepdf
is another actionscript library for creating Pdf file.

Creating a chart with tool tips in a Web Garden

I need to show a Line Chart on an ASP.NET page where each data point has a tooltip that shows its exact X and Y values. A chart for a particular dataset will probably only ever be requested once, so caching is disabled and the chart will be regenerated if it ever needs to be shown again.
Restrictions:
Needs to work in a web garden environment
Cannot use Session
Cannot use rich media, such as Flash or Silverlight.
The approaches I've seen used an image map for a generated chart image. Due to the restrictions, all of my charts so far have been generated in a handler in memory, streamed directly back to the user, and then disposed of. Now I need to add tool tips, which would requires both HTML and an image.
My current plan is to generate the chart once on the page to get the HTML, ignore the generated image, and rewrite the "src" of the image tag to point to a second page. The second page generates the same exact chart as the first, ignores the HTML markup, and streams the image back to the client. This all seems very kludgy.
Is there an better way to do this that doesn't involve generating the chart twice?
Available chart controls:
Dev Express 8.2
Syncfusion 6.2
?? - Recommend something
What about using the Google Chart API, and a .Net wrapper? See this SO discussion for more information.
I solved this by using the MS Chart Control. The disk handler can share images across servers in the web garden and automatically cleans up after itself.

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.

ASP.NET component that allows online Annotation of PDF files

We are trying to develop an application to view and annotate PDF files in ASP.net.
The function involves capturing x,y coordinates from a click and placing the annotation on that specific location.
Are there available components to do this?
Thanks in advance.
I am not sure I have enough information to provide a specific answer to your question, but perhaps this info can get you started...
If I understand correctly, you are going to provide some UI that will enable the user to point to the location of the annotation when viewing the document, then you will modify the PDF on the server, and render it with the annotation at the point selected by the user.
Perhaps one way you can capture mouse input to enable the user to select the location of the annotation is to render an image of the PDF document page and show it on the page, and then capture the mouse location on a click event.
Then, if you have the annotation and the desired location, you could use a PDF library to update the PDF and draw your annotation into the document on the specified page at the specified X,Y coordinates.
We are using a PDF generation library that we are very happy with to render PDF documents on the web server, which we deliver to the browser via our ASP.NET application.
You might want to take a look at this product and see if it can meet your needs:
DynamicPDF from ceTe software: http://dynamicpdf.com/
Hope this helps.
We are also looking at this and found this Java applet which does the job very well.
I've used iTextSharp in the past, to annotate PDFs of Piping & Instrumentation diagrams - worked rather well.
We have also looked at jPDFNotes at qoppa, and had good results with it.

Resources