I have been using the C1Pdf in Winforms for a couple of months. I have no issues with creating Winforms versions. I have now been asked to create a web application that will dynamically create a PDF file. Specifically the user will select some criteria from a web page. From the criteria selected a call on the SQL server will grab specific data which I will then use to build the PDF file. The PDF will be generated from both text and some graphics.
Just to let you know that before posting this I have read through all the C1Pdf documentation I could find (on this site and others) and find very little reference or examples on how to use the C1Pdf in an ASP.NET application. It is only out of total frustration that I am posting this newbie type question.
As I am totally unfamilar with how to use C1Pdf in ASP.NET I thought it best to start out with something very easy. So as a test I thought I would create a web version of the Visual Basic Winforms 'PdfForm' example that ships with the ComponentOne Suite of products. My application will have the same C1Pdf.DrawImage and C1Pdf.DrawString requirements as detailed in the C1Pdf PdfForm example so if I can get it to work, making my application won't be that hard.
First question:
I am at a total loss as to how to correctly load the IO.Stream. The code in the Winforms version uses:
Dim
resName As String = "PdfForm.faxcover.emf"
Dim s As IO.Stream = [Assembly].GetExecutingAssembly().GetManifestResourceStream(resName)
Dim img As Image = Image.FromStream(s)
I use VS2005 and I get an error "Name 'Assembly' is not declared. Can someone tell me what should be referenced instead of 'Assemby' to make this work.
Second Question:
So I decided to comment out the DrawImage (IO.Stream) section all together just to see if I could get a text based PDF to work. It gets to the first line of code:
Dim rc As New RectangleF
rc = _c1Pdf.PageRectangle
It then gives me the following error and stops.
{"Object reference not set to an instance of an object."}
Any help on what the heck I am doing wrong would be greatly appreacited.
Thanks,
Chris