Rank: Newbie Groups: Member
Joined: 6/20/2013 Posts: 6
|
I am pulling a PDF document stored in an Oracle database as a BLOB column.
How do I convert this BLOB column to a PDF in C# code?
I am thinking something like this: OracleBlob long_blob = reader.GetOracleBlob(1); PdfDocument dossier = new PdfDocument(long_blob); PdfDocument doc = PdfDocument.Merge(doc, dossier);
Can you please help me?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, You would need to convert your blob to a byte array, then you would do something like this:
Code: C#
//Get the raw byte data from your blob
byte[] pdfFileData = get_your_pdf_file_data();
//Create a MemoryStream based on the raw file data
MemoryStream ms = new MemoryStream(pdfFileData);
//Load it into a PdfDocument object
PdfDocument doc = new PdfDocument(ms);
Hope this helps. Please feel free to let us know if you have any questions. Thanks!
|