locked
Best way to send data to pdf writer. RRS feed

  • Question

  • User-170437103 posted

    What is the best way to send data from a database to a pdf writer?

    Example:

    database -> c# object -> xml + xslt ->pdf writer

    or

    database ->c# object ->html -> pdf writer

    or

    ?

     

    I dont do database -> xml as business logic is need on the data.

    Later I also would like to use this principle for sending data to a printer.

    Wednesday, April 28, 2010 4:48 AM

Answers

  • User-1225687272 posted

    database -> c# object -> XML Serialization ->pdf writer

    Create PDF Files in C# http://www.developerfusion.com/code/5682/create-pdf-files-on-fly-in-c/

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 28, 2010 7:59 AM
  • User-457597647 posted

    As you're planning to send output to a printer or PDF file, you might find it convenient to layout pages using System.Drawing or XAML.

    The System.Drawing code of a PrintDocument can be reused to generate a PDF document with ABCpdf.NET from webSupergoo. See the System.Drawing example for more details.

    ABCpdf also supports Windows Presentation Foundation (WPF), the graphics sub-system developed for .NET 3.0.  Define your page layout using Extensible Application Markup Language (XAML) and then send it to your printer with the PrintDialog.PrintVisual method. The WPF Table example shows how to take WPF based content and turn in into a PDF.



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 10, 2010 5:34 AM

All replies

  • User-1225687272 posted

    database -> c# object -> XML Serialization ->pdf writer

    Create PDF Files in C# http://www.developerfusion.com/code/5682/create-pdf-files-on-fly-in-c/

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 28, 2010 7:59 AM
  • User-952121411 posted

    The best way may depend on the interface or API exposed by the PDFWriter you are using.  I recommend iTextSharp as it is free and there are a bunch of examples on how to program against it in C#:

    iTextSharp: 

    http://itextsharp.sourceforge.net/

    Obviously the Database -> C# Object is great, but you may be able to port the data within the object directly to the writer without any further translation.  It really depends on the tool you are using.

     

    Wednesday, April 28, 2010 3:33 PM
  • User-457597647 posted

    As you're planning to send output to a printer or PDF file, you might find it convenient to layout pages using System.Drawing or XAML.

    The System.Drawing code of a PrintDocument can be reused to generate a PDF document with ABCpdf.NET from webSupergoo. See the System.Drawing example for more details.

    ABCpdf also supports Windows Presentation Foundation (WPF), the graphics sub-system developed for .NET 3.0.  Define your page layout using Extensible Application Markup Language (XAML) and then send it to your printer with the PrintDialog.PrintVisual method. The WPF Table example shows how to take WPF based content and turn in into a PDF.



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 10, 2010 5:34 AM
  • User-170437103 posted

    Thnx for your help. 

    I conclude; the model follows the way the pdf/printer tool works.

    Monday, May 17, 2010 5:59 AM