============== PROBLEM ================
I have to integrate a small part in .NET Projects. .NET project is
actually all Web-based application, user interface is Web-page for
But a backend component of project needs PDF File manipulation.
Manipuation is limited to splitting pages, removing certain pages,
joining pages, finding certain text information (Title/Author/No. of
Pages/Orientation of each page etc), and page orientation maipulation
(rotating pages clockwise and anticlockwise, on degree parameter,
.NET guys are failing here, so I proposed to do that component in Python.
But problem is, how to integrate Python in .NET Web Application. I am
looking on IRONPYTHON, and thats the only point seemed to me. Also, as
I am not an expert in Python, I have transition from Perl and PHP to
python. So right now, my applciation architecture would little bit be
inexperienced and not enterprise ready. But every component in project
is being worked on Enterprise grade.
I want to integrate Python implementation for PDF works, and that
would be called from .NET (C#) processes supplying required
parameters. Since the whole application would be implemented on MS
Windows Server, so I am bit lacking the freedom of library usage as in
Also looking for best PDF library which doesn't have any or many
dependencies and that dependencies can be successfully installed. I
will also need an XML Library to write down the logs and
instructions+information for next component which handles Printing.
Therefore, I am seeking all the precious (even small or one-liner)
advices from you. Please suggest me every possible things that come in
your mind. Things on high priorities right now are:
More questions will follow up :)
And I hope, people will reply me.
Never done Python/.NET integration, so I can't help you there.
PDF library: ReportLab. But that is most generation of PDFs. For reading,
splitting, etc, you may have to look at their commercial offering. And I
do believe it is all pure python.
XML: ElementTree http://effbot.org/zone/element-index.htm Should be all
Hope that helps some.
Everybody will tell you "reportlab", but AFAIK the open-source kit does not
provide manipulation of existing pdf file contents - "only" creation. Besides
it's targeted at CPython and it isn't 100% clear it runs perfectly on other
implementations; so have a look at itextsharp - it might better fit your needs
if you decide to use IronPython.
If I had to do something like this I would host a Python web
server listening on some port and let .NET application talk to me
using HTTP requests preferably or SOAP if I really had to.
It could be a Paster or Cherrypy or Twisted based server.
Google for instruction on how to package it using py2exe
into a windows service.
The service could be hosted on the same server as .NET or a separate
> - Any suggestions for optimizations that would prevent overburden to
> application due to IronPython interpretation calling, if any, or does
> such things happen.
> - Pointers to good resources
> - Any step in such kind of situation, so to make it Enterprise Grade
> application components
I do not have Enterprise Grade Seal of Approval but similar setup is
running successfully at my workplace for the last 2 years.
> - your opinion with available PDF Libraries, that are best among. Also
> which library to use for Windows server platform (there is limitation
> on installing long chain libraries that include other deep
> dependencies too). A pure python PDF library would be good, but which
> -Which XML Library is pure python based.
I will have to research on it, i think time to list the best available
libs, and finding all's dependency.
> On Dec 19, 2007 6:10 AM, Boris Borcic <bbo...@gmail.com> wrote:
> Everybody will tell you "reportlab", but AFAIK the open-source kit does not
> provide manipulation of existing pdf file contents - "only" creation. Besides
> it's targeted at CPython and it isn't 100% clear it runs perfectly on other
> implementations; so have a look at itextsharp - it might better fit your needs
> if you decide to use IronPython.
iTextSharp look very promising. But i am unable to find any good
documentation. I think i will have to buy the book, so that I can have
API docs just beside me for reference.
One thing I am stuck at right now. the IronPython 1.0.2467 on .NET
2.0.50727.42 is installed on my Ubuntu, so does CPython 2.5 libraries
can be called in it without any problem.
In ipy shell,
['/home/rskumar', '/usr/lib/ironpython/Lib', '/usr/lib/python2.4',
so it uses Python 2.4 libs. I am fearing to mix the 2.4 and 2.5 libs.
I need to load CPython 2.5 libs by adding it in site.py file of
ironpython. Maybe I should go experimenting and let you people know
Thats is the best solution to me also, but restrictions are I cann't
consume extra service for it. I need tight integration and no remote
service calls, thats why it seems bit tricky to me., and i am working
to integrate Python implementation in .NET.
So where the .NET application has to work with PDF part, it will
invoke the IronPython Engine, pass required configurations and
parameters, and get the result+exceptions etc.
Noted for my reference. Thanks :)
> > -Which XML Library is pure python based.
So ElementTree solved one part. thanks friend.
This isn't a "python" reply, but for .NET PDF manipulation, you might
look at http://www.pdfbox.org/userguide/dot_net.html