MVC using .netCharting and ABCpdf - c#

Quick Question: Is it possible to use .netCharting with MVC by streaming data from a database (using Entity Framework) and generating a PDF (using ABCpdf) by an output stream of the generated chart images/bit-maps? I want to generate the charts on server-side, so I don't think having an HTML page render the charts would be correct.
Interaction: The user should be be able to submit their data from a form, have it stream to the database, and then when an admin logs in, they can view a list of users, and be able to
click a button, which generates the updated chart PDF of the specific user from the DB.

Where I work we use .netCharting and ABCpdf to produce a lot of documents, generally financial documents with embedded charts, so yes, it is certainly possible. We always use html to generate the pages and this is all done on the server side.

Related

How to create template and generate pdf using template and database data iText C#

I want to do below task using iText7.
create template using HTML or ..(some fields can be able to hide
according to user input)
Fill the template with the database data
generate accessible pdf
How can I do this?
As far as I understand, you want to have an HTML template where you will fill in data based on user input as well as data coming from your database. This is possible in iText in general, however you would need to do a lot of work, especially if you want to have a template for the PDFs that you are going to generate (as well as the template for the HTML form for capturing data).
It would be nice to have a tool where we design the HTML form and the form with which the output PDF is going to be generated interactively and maybe even using the same resources, sub-forms, sub-templates etc. Then the only thing the technical person would do is to bind the actual data to the form elements. The template will have the logic to show/hid elements or any other conditions that you might come up with. It would simplify the workflow a lot.
iText is working on a product called Dito which was announced in GIDS 2018 in Bangalore, India and a demo session was given. Dito is going to do exactly what you want and what I describe above. You can find the presentation here: http://www.developermarch.com/developersummit/downloadPDF/Dito.pdf
You can find also document workflow here: https://itextpdf.com/sites/default/files/attachments/LL_iText_Infographic_Flyer_A4-pdf.pdf

How to generate PDF Files based on a HTML+CSS+jQuery page containt

I'm trying into my ASP.NET MVC 4 web-app based on C#, to allow the end-user to download a pdf-file, which it will be generated from an HTML+CSS+JQuery coded page. In fact, this page contains HTML text fields which allows end-users to enter data and then to generate statistics will be displayed in the same web-page to deal this I have used highcharts, a jQuery library which displayes statistics based on data inputs.
The problem here, that I have tried to implement Rotativa (doesn't work with ASP.NET MVC 4), ITextSharp, all what they offer is the conversion of a pure HTML file into PDF, and, doesn't take the fact of the jQuery charts.
You can try jsPDF. it is an open-source library for generating PDF documents using nothing but Javascript.
link for JsPDF

Multiple page document upload and display c#

I have a functionality where I need to upload a multi-page document. For display purposes, I have to give the user ability to view it page-vise. I have to show no. of pages and then user can navigate back and forth between the pages to view each page.
Any pointers on how this can be accomplished? I am using ASP.Net MVC3 and C# as the language.
Much Thanks!
If by "multi-page document" you mean like a PDF or word doc, then you'll need to embed a 3rd party viewer in your page and have it display. Generally they have the functionality you've mentioned built-in.

Writing to a PDF with fields from SQL Server 2005

I'm running an asp.net 4 / c# site using SQL Server 2005 and want to write column values from within SQL Server into a PDF file which already has content inside it (I want to personalise a PDF voucher that you get from the logged in page on my site)
Is there an easy tutorial to look at or is this a much bigger job?
There are two parts here:
Read data from database (for example, using ADO.NET, Entity Framework, e.t.c.)
Write that data to a PDF document (using some free or commercial PDF tool, like iTextSharp, SharpPDF, XPDF, Docotic.Pdf, e.t.c)
You can look at this article that describes both parts in detail.
Well, I think you have several options out there.
For example, you can create a PDF document based on a template using iTextSharp.
In that case, the template is the existing voucher you mention. You'd have to replace the information inside it, by identifying the fields, or something like that.
Something similar could also be accomplished using PDFSharp.
Just pay special attention when using iTextSharp to its license agreement, since its AGPL, which means your software must be GPL/AGPL as well.
Now, if you want to avoid interacting with PDF objects, and APIs, you have one other alternative. Which is to create an RDLC local report, and directly export it to PDF from your codebehind. In this case, it wouldn't be based on an existing voucher, it would be created from scratch.

Server-side printing in C#/ASP.NET

On the server that my application is being run on, a virtual PDF printer is being installed (don't know much about this yet, except it's from Adobe), and my application needs to use this 'printer' to create PDF's from HTML pages (a GridView mostly), and then redirect the user to the URL of the where the PDF is stored.
I've been looking at the PrintDocument object in System.Drawing.Printing, however I've read that you can't simply feed this a HTML page. What are my choices? The easiest option would be to be able to 'print' a given HTML page (choosing what and what not to print using CSS), but from what I've read this is fairly difficult, so I'm thinking about somehow constructing whatever object PrintDocument needs programatically, if that makes sense.
Any ideas on how I should do this?
there are some free/cheap libs for creating pdfs on the fly. I've used itextsharp before and it worked pretty well. Takes a bit of time to get up to speed in how it works but I'd suggest checking it out.
There are also printing services like Neevia DocConverter that will monitor a folder and auto convert whatever you put in the folder to a pdf, jpg, etc. you can set it up so that if you drop a url shortcut in the folder it will render the webpage at that url to pdf. it's a bit more of a pain if you want to do realtime rendering but works excellent for generating mass reports in batches that you want to post up to a website or email later.

Categories