| |||
ayuda con c# hola amigos quiero ver si alguien me puede ayudar, lo que pasa es que necesito pasar html en c# a pdf, puedo pasar de texto a pdf sin problemas pero de html aun no puedo,trato y trato y no puedo alguien me ayuda plz????? |
| ||||
Re: ayuda con c# Que componente estás usando para pasar a PDF porque puedes ocupar el iTextSharp totalmente open source y que se adapta a lo que necesitas Salu2
__________________ Nadie roba nada ya que en la vida todo se paga . . . Exentrit - Soluciones SharePoint & Net |
| |||
Re: ayuda con c# muchas gracias por la respuesta, si uso el itextsharp y puedo pasar cualquier txt por decirlo asi a pdf, pero de html a pdf y me tira errores weones que no deberian salir, con este codigo deberia pasarse segun yo ke son los ejemplos, pero me tira errores con con el catch, ojala me puedan ayudar es de suma importancia :( using System; using System.IO; using System.util; using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.xml; using System.Collections; using iTextSharp.text.html; namespace iTextSharp.tutorial.Chap07 { /// <summary> /// Chap0706 ժҪ˵ /// </summary> public class Chap0707 { public Chap0707() { Console.WriteLine("Chapter 7 example 7: parsing the HTML from example 2"); // step 1: creation of a document-object Document document = new Document(PageSize.A4, 80, 50, 30, 65); try { // step 2: // we create a writer that listens to the document // and directs a XML-stream to a file PdfWriter.GetInstance(document, new FileStream("Chap0707.pdf", FileMode.Create)); // // step 3: we create a parser and set the document handler // Parser parser = ParserFactory.makeParser(PARSER); // parser.setDocumentHandler(new SAXmyHtmlHandler(document)); // step 3: we create a parser // ITextHandler h = new ITextHandler(document); HtmlParser.Parse(document,"Chap0702.htm"); // step 4: we parse the document _Document; // h.Parse("Chap0702.htm"); // step 4: we parse the document // parser.parse("Chap0702.html"); } catch(Exception e) { Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); } } } } |
| ||||
Re: ayuda con c# Cita: y cuales son esos errores? me tira errores weones que no deberian salir
__________________ Nadie roba nada ya que en la vida todo se paga . . . Exentrit - Soluciones SharePoint & Net |
| |||
Re: ayuda con c# private void button3_Click(object sender, EventArgs e) { Console.WriteLine("Chapter 7 example 7: parsing the HTML from example 2"); // step 1: creation of a document-object Document document = new Document(PageSize.A4, 80, 50, 30, 65); try { // step 2: // we create a writer that listens to the document // and directs a XML-stream to a file PdfWriter.GetInstance(document, new FileStream("Chap0707.pdf", FileMode.Create)); // // step 3: we create a parser and set the document handler // Parser parser = ParserFactory.makeParser(PARSER); // parser.setDocumentHandler(new SAXmyHtmlHandler(document)); // step 3: we create a parser // ITextHandler h = new ITextHandler(document); HtmlParser.Parse(document, "Chap0702.htm"); // step 4: we parse the document _Document; // h.Parse("Chap0702.htm"); // step 4: we parse the document // parser.parse("Chap0702.html"); } catch (Exception e) { Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); } } este es el codigo del boton ke deberia traspasar de html a pdf y me arroja los siguientes errores Error 1 A local variable named 'e' cannot be declared in this scope because it would give a different meaning to 'e', which is already used in a 'parent or current' scope to denote something else C:\Documents and Settings\Administrador\Mis documentos\Visual Studio 2005\Projects\WindowsApplication3\WindowsApplicati on3\Form1.cs 187 13 WindowsApplication3 Error 2 No overload for 'button3_Click' matches delegate 'System.EventHandler' C:\Documents and Settings\Administrador\Mis documentos\Visual Studio 2005\Projects\WindowsApplication3\WindowsApplicati on3\Form1.Designer.cs 65 35 WindowsApplication3 alguien ke cache ayudeme porfis :) |