Posted By: dotnetjunkie | Apr 2nd, 2006 @ 1:53 AM
page 1 of 1
Comments: 15 | Views: 10764
What is the best (preferably free) library / component to generate a PDF file from within our .NET code?

BTW, I'm using Visual Studio 2005 - .NET 2.0, so it would be best if the library were 2.0 as well...
armbrat
armbrat
Ricky
I had to populate existing PDF forms, and this was the component I licensed.

http://www.o2sol.com/pdf4net/products.htm

It works quite well - no problems.

Hey Use Nfop thats very easy to use and you can use xsl-fo for the transformation. This code snippet is from one of my projects - had a hard time finding a good example.


                // Load the style sheet.

                string xslfofile = m_Process.Root + @"\Custom\Components\FrontEnd\Xsl\-pdfxslfo.xsl";

                // Execute the transform and output the results to a file.

                string xslfo = InventIt.SiteSystem.Library.CommonXml.TransformXsl(xslfofile, m_Process.XmlData, m_Process.Cache);
                java.io.StringReader streamFO = new java.io.StringReader(xslfo);
                InputSource src = new InputSource(streamFO);

                java.io.ByteArrayOutputStream streamOut = new java.io.ByteArrayOutputStream();
                Driver driver = new Driver(src, streamOut);
                driver.setRenderer(1);
                driver.run();


                System.Web.HttpResponse response = m_Process.HttpPage.Response;
                m_Process.OutputHandledByModule = true;
                response.Clear();

                response.AddHeader("Content-Disposition", "attachment; filename=pension.pdf");

                sbyte[] sB = streamOut.toByteArray();

                byte[] b = new byte[sB.Length + 1];

                for (int i = 0; i < sB.Length; i++)
                {

                    b[i] = (byte)sB[i];
                }


                response.BinaryWrite(b);

                response.Flush();
                response.Close();
                streamOut.close();

Red5
Red5
Systems Manager Curmudgen
PocketXP wrote:


Hey Thanks!  I needed a PDF assembly like this.  It helped solved one of my problems today.
mawcc
mawcc
Make it so
You could also use the new Report Controls in local processing mode. All reports can be exported as PDF (or XLS).
dotnetjunkie wrote:
What is the best (preferably free) library / component to generate a PDF file from within our .NET code?

BTW, I'm using Visual Studio 2005 - .NET 2.0, so it would be best if the library were 2.0 as well...


there are many tutorials and example codes you can get from
http://hardrock.cnblogs.com
http://steedsoft.com/itextsharp/tutorial01/

and there are some examples that use iTextsharp on asp.net 2.0
http://aspspider.net/tonyfox/pdf/
Harlequin
Harlequin
http://twitter.c​om/TrueHarlequin
Would be nice if PDF was just an Xml format you could just stream into a PDF mime Smiley

These 3rd party generators are just not fun to work with.
TommyCarlier
TommyCarlier
I want my scalps!
You mean, like XPS Wink
staceyw
staceyw
Before C# there was darkness...
dotnetjunkie wrote:
What is the best (preferably free) library / component to generate a PDF file from within our .NET code?

BTW, I'm using Visual Studio 2005 - .NET 2.0, so it would be best if the library were 2.0 as well...


Not sure what your exact needs are, but the ReportViewer control will produce a pdf for the user.  So you can output your report using the report viewer, then the user can save.  Not sure if you can output pdf by just calling a method on the control or not, I would think so, but have not tried. 
staceyw
staceyw
Before C# there was darkness...
TommyCarlier wrote:
You mean, like XPS Wink


Right Smiley.   I am looking forward to RTM on that.
Hi,

          Could you plz  solve my problem  How to  convert  the Asp.net datagrid contents  to pdf.  Could you give me a code

regards
kumar

Hi,

             Could you plz  solve my problem how to Convert the pdf  from asp.net datagrid contents using iTestSharp.

 

regards

tm555

odujosh
odujosh
Need Microsoft SUX now!
Use a telerik grid. It offers export to PDF, XLS, and Doc for free. Well worth the 200 for a liscense because of all the other stuff it does.
littleguru
littleguru
<3 Seattle
You read the title of the thread, right?
page 1 of 1
Comments: 15 | Views: 10764
Microsoft Communities