On 8/31/2013 3:40 PM, Paul Johnson wrote:

Hi ,

I'm using pdfforms (sample create w9 ) which is great but is there a way not to open the application on the client side but to save it directly to sql server database for the user to download at a later stage.

Sorry if you have been asked this question before but can't find or understand any search results on google. (I'm new to asp.net developing )


You don't find a ready-made answer on the net, nor will you get a ready-made answer here, because there are just too many ways to achieve what you want. The best way depends on the type of database you have, your architecture, your environment, etc...

The best anwer you'll get, will consist of some pointers:

When you say you want to store PDFs in a database, you are actually talking about storing BLOBs. PDF is a binary file format, so you need a database that can deal with Binary Large OBjects: http://en.wikipedia.org/wiki/BLOB

Search your database manual to find out how to create a table with BLOB fields and how to write code (C#? Java?) to INSERT or SELECT such a BLOB.

iText(Sharp) writes a PDF file to an OutputStream. This can be a FileOutputStream, ServletOutputStream, ByteArrayOutputStream, etc...

If this code to write a BLOB to a record accepts an OutputStream of some sort, then you're good to go, but chances are that you'll need a byte array.

In that case, you'll need to write your PDF to a ByteArrayOutputStream, and as soon as you've closed the document, you can use the toByteArray() method to get the bytes of the file. These bytes form the BLOB that needs to be inserted in the database.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to