PDF Library for use with NHibernate?

94 views
Skip to first unread message

Will Shaver

unread,
Sep 12, 2008, 12:07:42 PM9/12/08
to nhu...@googlegroups.com
Anyone have a recommendation for a PDF library for use with NH and ASP.NET MVC?
 
Of course a permissive open source license is best. :)
 
 
 -Will
 
 

Nathan Stott

unread,
Sep 12, 2008, 12:09:25 PM9/12/08
to nhu...@googlegroups.com
TextSharp

Victor Kornov

unread,
Sep 12, 2008, 12:11:35 PM9/12/08
to nhu...@googlegroups.com
Just curious, how pdf is related to NH (orm) & MVC (web)?

Will Shaver

unread,
Sep 12, 2008, 12:15:29 PM9/12/08
to nhu...@googlegroups.com
I'd like to be able to generate PDF files from my NHibernate based Asp.Net MVC application. Mostly as a way to provide a nice way of printing reports etc. There are a whole bunch of libraries out there, but perhaps some of them are easier to use with NHibernate than others.

Jozef Sevcik

unread,
Sep 12, 2008, 12:27:08 PM9/12/08
to nhu...@googlegroups.com
iTextSharp

2008/9/12 Will Shaver <will....@gmail.com>

Anyone have a recommendation for a PDF library for use with NH and ASP.NET MVC?
 
Of course a permissive open source license is best. :)
 
 
 -Will
 
 





--
S pozdravom / Best regards,

Jozef Ševčík
sev...@styxys.com

+420 608 782 813
+420 222 364 769

Bruno Matos

unread,
Sep 12, 2008, 12:27:17 PM9/12/08
to nhu...@googlegroups.com

Tim Scott

unread,
Sep 15, 2008, 10:18:26 AM9/15/08
to nhusers
I have quite happily used NFOP. http://sourceforge.net/projects/nfop

Pluses: I gives you extreme control over style and layout. Layout and
styling is declarative.
Minusus: Content is serialized to XML, so requires some rather heavy
plumbing bits. The project is basically dead I think. Written in J#.

I did not know of iTextSharp when I picked up nFOP. I would look at
that first.

Will Shaver

unread,
Sep 15, 2008, 11:56:08 AM9/15/08
to nhu...@googlegroups.com
Thanks all for the responses.
 
 -Will

Tobes

unread,
Sep 16, 2008, 9:33:49 AM9/16/08
to nhusers
Lol, I'd say this is a bit off topic :)

I tend to use PDF libraries as late in the game as possible.
Basically, I do this:

1. Don't bother learning to use a PDF library, and spending hours
farting about trying to design a reports using a code API.

2. Create reports as web pages in HTML / ASP.NET, just like any other
pages in your site. You can work with the design and layout tools you
know and love - such as CSS and notepad :). HTML gives you great
control over character sets, directional layout for RTL languages,
images, CSS etc. You also can use cool ASP.NET graphing libraries,
image libraries, etc etc.

3. Find a PDF library that can **import** a web page to the standard
you need. Usually something like this:

SomePDF.AddPage("http://127.0.0.0/Invoices/PrintPreview/1234",
Options.AddPageNumbers);

4. So, you can now turn web pages into PDFs. You can stream them to
the browser like this: Response.WriteFile( SomePDF.OutputStream );

I've used this approach on 5 projects so far (NET and Ruby on Rails),
and I personally like it a lot. The 2 libraries I've really enjoyed
are these:

- AbcPDF (.NET) - http://www.websupergoo.com/abcpdf-1.htm. Try the
online demo, it's amazing. They used to give out free licenses if you
put them on your home page.
- Pd4ML (Java, .Net in public Beta) - http://pd4ml.com/. The
international (Arabic, Central European etc) support in this was
perfect, and it's fast.

Tobin


On Sep 15, 4:56 pm, "Will Shaver" <will.sha...@gmail.com> wrote:
> Thanks all for the responses.
>
>  -Will
>
> On Mon, Sep 15, 2008 at 7:18 AM, Tim Scott <timasc...@gmail.com> wrote:
>
> > I have quite happily used NFOP.http://sourceforge.net/projects/nfop

Victor Kornov

unread,
Sep 16, 2008, 10:03:58 AM9/16/08
to nhu...@googlegroups.com
Just be aware that most, if not all, such libs are using IE engine to capture the html, so that becomes your most important browser :)

Fabio Maulo

unread,
Sep 16, 2008, 10:19:17 AM9/16/08
to nhu...@googlegroups.com
2008/9/16 Victor Kornov <wee...@gmail.com>

Just be aware that most, if not all, such libs are using IE engine to capture the html, so that becomes your most important browser :)

Only a curiosity.... (OT)
Which browser are using NH community ? (or at least who visit www.nhforge.org )
Firefox 54.76%
IE 28.11%
Chrome 12.24%
Opera 2.94%
Safari 1.57%

--
Fabio Maulo

Tobes

unread,
Sep 16, 2008, 6:26:15 PM9/16/08
to nhusers
@Victor

I'm running PD4ML on a Debian server with no GUI. Are you sure it's
using IE? Are you sure that any of them use IE?

Tobin

On Sep 16, 3:03 pm, "Victor Kornov" <wee...@gmail.com> wrote:
> Just be aware that most, if not all, such libs are using IE engine to
> capture the html, so that becomes your most important browser :)
>
> On Tue, Sep 16, 2008 at 5:33 PM, Tobes <tobinharris...@googlemail.com>wrote:
>
>
>
> > Lol, I'd say this is a bit off topic :)
>
> > I tend to use PDF libraries as late in the game as possible.
> > Basically, I do this:
>
> > 1. Don't bother learning to use a PDF library, and spending hours
> > farting about trying to design a reports using a code API.
>
> > 2. Create reports as web pages in HTML / ASP.NET, just like any other
> > pages in your site. You can work with the design and layout tools you
> > know and love - such as CSS and notepad :). HTML gives you great
> > control over character sets, directional layout for RTL languages,
> > images, CSS etc. You also can use cool ASP.NET graphing libraries,
> > image libraries, etc etc.
>
> > 3. Find a PDF library that can **import** a web page to the standard
> > you need. Usually something like this:
>
> >    SomePDF.AddPage("http://127.0.0.0/Invoices/PrintPreview/1234",
> > Options.AddPageNumbers);
>
> > 4. So, you can now turn web pages into PDFs. You can stream them to
> > the browser like this: Response.WriteFile( SomePDF.OutputStream );
>
> > I've used this approach on 5 projects so far (NET and Ruby on Rails),
> > and I personally like it a lot. The 2 libraries I've really enjoyed
> > are these:
>
> > - AbcPDF (.NET) -http://www.websupergoo.com/abcpdf-1.htm. Try the
> > online demo, it's amazing. They used to give out free licenses if you
> > put them on your home page.
> > - Pd4ML (Java, .Net in public Beta)  -http://pd4ml.com/. The

Victor Kornov

unread,
Sep 16, 2008, 7:06:55 PM9/16/08
to nhu...@googlegroups.com
I'm not sure about PD4ML, or most of them, or just any of them. I know some do use it, or did use. I wanted to quickly find a proof link on ajaxian.com, but failed. So, if you want, you cant just ignore me altogether. I simply wanted to give a hint of what to be aware of. Since it's utterly possible to use IE to render remote html in-memory and capture that as a pdf. I'm not an expert in the matter, but for quite some time IE was the only embeddable browser through it's ActiveX engine. Has that changed?

P.S. Just don't take me personal, I have not intended that.

Tobes

unread,
Sep 17, 2008, 7:25:12 AM9/17/08
to nhusers
Hi Victor

Sorry, didn't mean to sound short :)

You made a fair point - no-one wants a lots of IE instances clogging
up their server resources, so it is a good thing to watch out for. 'm
sure some libraries take this approach.
I'm pretty sure that PD4ML and AbcPDF I mentioned are "server
friendly", with no dependencies on IE, but I haven't run a dependency
check on them lately.

Tobin

On Sep 17, 12:06 am, "Victor Kornov" <wee...@gmail.com> wrote:
> I'm not sure about PD4ML, or most of them, or just any of them. I know some
> do use it, or did use. I wanted to quickly find a proof link on ajaxian.com,
> but failed. So, if you want, you cant just ignore me altogether. I simply
> wanted to give a hint of what to be aware of. Since it's utterly possible to
> use IE to render remote html in-memory and capture that as a pdf. I'm not an
> expert in the matter, but for quite some time IE was the only embeddable
> browser through it's ActiveX engine. Has that changed?
> P.S. Just don't take me personal, I have not intended that.
>
Reply all
Reply to author
Forward
0 new messages