aic007 Posted April 18, 2007 Share Posted April 18, 2007 Hi.I did a bit of googling, but could not find what I was looking for. I was wondering if somebody could help me with some examples of customized printing ? Is it possible at all ? Can I take input from textboxes and then put it in my own pdf document for instance and then print it out ? Link to comment Share on other sites More sharing options...
jesh Posted April 18, 2007 Share Posted April 18, 2007 If you are talking about ASP.NET (i.e. web-based) then printing is a client-side function that happens in the browser; the only thing you'd be able to do in ASP.NET is to send the following javascript to run on the client-side: <script type="text/javascript">window.print();</script> Generating a PDF, however, isn't a bad idea. You could generate the PDF and send it to the user for downloading. For more info on generating PDFs, check Google: http://www.google.com/search?q=asp.net+pdf+generator Link to comment Share on other sites More sharing options...
aic007 Posted April 18, 2007 Author Share Posted April 18, 2007 Ok man. Thanx Link to comment Share on other sites More sharing options...
aic007 Posted April 20, 2007 Author Share Posted April 20, 2007 Hi.I have downloaded the itextsharp.dll file, but don't how to use it in visual studio. somebody plzz help me here ? Link to comment Share on other sites More sharing options...
aspnetguy Posted April 20, 2007 Share Posted April 20, 2007 place the dll file in your projects bin folder. Then in vs right click on references from the solution explorer and choose Add. Browse to your bin folder and select the dll. It should now be in your selection list. Press OK.Then at the top of every page you want to se it on you use this statement (C#)using dllNamespace; //replace with correct namespace[.sub namespace] declarations. Link to comment Share on other sites More sharing options...
aic007 Posted April 20, 2007 Author Share Posted April 20, 2007 Thaanx alot for helping Link to comment Share on other sites More sharing options...
aic007 Posted April 22, 2007 Author Share Posted April 22, 2007 It's not that I'am lazy or something like that, but I have googled alot and studied alot without being able to understand what to do in order to generate a pdf file that contains information that user has typed in a .aspx form. If someone could help me a bit with a good and detailed example I would be very thankful. Link to comment Share on other sites More sharing options...
aic007 Posted April 22, 2007 Author Share Posted April 22, 2007 Im back again with stupid questions I use this code; protected void Button1_Click(object sender, EventArgs e) { Console.WriteLine("Chapter 1 example 1: Hello World"); // step 1: creation of a document-object Document document = new Document(); try { // step 2: // we create a writer that listens to the document // and directs a PDF-stream to a file PdfWriter.GetInstance(document, new FileStream("Chap0101.pdf", FileMode.Create)); // step 3: we open the document document.Open(); // step 4: we Add a paragraph to the document document.Add(new Paragraph("Hello World")); } catch (DocumentException de) { Console.Error.WriteLine(de.Message); } catch (IOException ioe) { Console.Error.WriteLine(ioe.Message); } // step 5: we close the document document.Close(); } and when I click on the button, nothing happens.. It is supposed to generate a pdf file, but nothing happens. Any1 have any idea what I am doing wrong ?I am using code from this site;http://itextsharp.sourceforge.net/tutorial/ch01.htmlplz help me Link to comment Share on other sites More sharing options...
aspnetguy Posted April 23, 2007 Share Posted April 23, 2007 try using only one catch statement and use a regualr Exception and use Console.Write to output the error. That way you can see the true compiler error not the custom error that somebody made up. Link to comment Share on other sites More sharing options...
aic007 Posted April 24, 2007 Author Share Posted April 24, 2007 Okay. I'll try that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now