How can I retrieve a PDF form from code?
I'm having trouble retrieving a PDF from my database using code. I've tried the different ways to no avail. Searching on the web also provides very little help as no one seems to have ever experienced what I'm experiencing.
From code I'm using a Binarywrite("blob") to get my PDF. My method is similar to this post here Convert Binary data to PDF file in C# and VB.Net. This code works if the PDF is just a PDF file. However, once it's prepared as a form PDF, it becomes corrupt.
I should clarify that it's not the original PDF that's corrupt, but rather how it's being written by the BinaryWrite. I know this because if I access my PDF using a client to access the DB, the PDF opens; this means that the blob is correct in the DB. It would appear that the BinaryWrite is not creating the PDF Form properly and hence, I get a corrupt file.
What is the best way for me to get this form from the DB without the form portion of it breaking? Am I missing a parameter or something? or should I not use BinaryWrite? or am I in need of a header value?
