Welcome Guest Search | Active Topics | Sign In | Register

Oracle Blob to PDF Document Options
PGL
Posted: Tuesday, June 24, 2014 5:01:06 PM
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?
eo_support
Posted: Tuesday, June 24, 2014 5:07:37 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.