How to export pdf data (byte[] format) from SQL database to PDF using C# ?
-
Hi everyone, I saved a pdf file into my database in byte[] format. And now, I want to show it in PDF reader program when clicking a button. But I don't want to create the pdf file in my hard drives (because, if create it, I need to delete it). Do you know how to export my data to pdf ? Thanks and regards, Tai
-
Hi everyone, I saved a pdf file into my database in byte[] format. And now, I want to show it in PDF reader program when clicking a button. But I don't want to create the pdf file in my hard drives (because, if create it, I need to delete it). Do you know how to export my data to pdf ? Thanks and regards, Tai
Apparently, it can be done - in C++ - but it's very complex, since Adobe PDF reader doesn't accept memory directly. See here: http://forums.adobe.com/message/2018299#2018299[^] I've also seen a suggestion that you should create a ramdisk at runtime, save it to that, and open the file from there - which kinda indicates the level of desperation you need to have to do it. Basically, I'd go with a "save it as a file in a particular folder and purge the folder regularly" approach, or possibly convert the PDF to HTML and display that. But there doesn't appear to be a "nice" solution.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
-
Apparently, it can be done - in C++ - but it's very complex, since Adobe PDF reader doesn't accept memory directly. See here: http://forums.adobe.com/message/2018299#2018299[^] I've also seen a suggestion that you should create a ramdisk at runtime, save it to that, and open the file from there - which kinda indicates the level of desperation you need to have to do it. Basically, I'd go with a "save it as a file in a particular folder and purge the folder regularly" approach, or possibly convert the PDF to HTML and display that. But there doesn't appear to be a "nice" solution.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
-
You're welcome - sorry it's not better news!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)