473,811 Members | 2,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A non-persistent file?

I have a pdf document saved (as a base64 encoded string) in a remote
database. I now want to allow the client application to display that
document. Because of legal issues I am not allowed to temporarily save
the pdf document on the local hard disk.

My question: Is there a way in C# and the .net framework to display
the pdf document, say in the Acrobat Reader, without saving the pdf
file to hard disk?

At a first glance I would say no. The Acrobat Reader needs the path to
a file name as an argument. And how could we tell the Acrobat Reader
at what location in memory the file would start?!

But on a second glance, maybe there is a part of the Windows operating
system that has some kind of unique file name (or some kind of handle)
and allows some kind of a data stream. Just an idea.

Thanks in advance,
Wolfgang
Jul 9 '08 #1
6 1597
>
At a first glance I would say no. The Acrobat Reader needs the path to
a file name as an argument. And how could we tell the Acrobat Reader
at what location in memory the file would start?!

But on a second glance, maybe there is a part of the Windows operating
system that has some kind of unique file name (or some kind of handle)
and allows some kind of a data stream. Just an idea.
Somewhere in the back of my head I have the idea that windows support
a kind of isolated storage , or something like that you could use to
save the file into.

Your problem though is the reader, if you find a component that
display a pdf (I think there are some around) you could display it
directly from your app and most probably without saving it to hdd.
Jul 9 '08 #2
The .NET isolated storage is still saved on the FileSystem, it is put in the
users profile area in Documents and Settings in the Application Data folder
or somewhere like that. The only option for this would be to find a PDF
viewer component that can open a PDF from a stream rather than from a file.
You would need to check this with the authors and check that it doesnt save
it to a temporary file to do it too.

Let us know if you find one that does it as it would be good to know for the
future.

--
Ciaran O'Donnell
http://wannabedeveloper.spaces.live.com
"Ignacio Machin ( .NET/ C# MVP )" wrote:

At a first glance I would say no. The Acrobat Reader needs the path to
a file name as an argument. And how could we tell the Acrobat Reader
at what location in memory the file would start?!

But on a second glance, maybe there is a part of the Windows operating
system that has some kind of unique file name (or some kind of handle)
and allows some kind of a data stream. Just an idea.

Somewhere in the back of my head I have the idea that windows support
a kind of isolated storage , or something like that you could use to
save the file into.

Your problem though is the reader, if you find a component that
display a pdf (I think there are some around) you could display it
directly from your app and most probably without saving it to hdd.
Jul 10 '08 #3
Wolfgang,

First things first, it is not possible to stream the data to a PDF reader.

Secondly, if you have to invoke the PDF reader, there has to be a file.
thus, with out writing onto disk, you can't achieve this task.

HTH

<wo************ ***@gmail.comwr ote in message
news:c4******** *************** ***********@56g 2000hsm.googleg roups.com...
I have a pdf document saved (as a base64 encoded string) in a remote
database. I now want to allow the client application to display that
document. Because of legal issues I am not allowed to temporarily save
the pdf document on the local hard disk.

My question: Is there a way in C# and the .net framework to display
the pdf document, say in the Acrobat Reader, without saving the pdf
file to hard disk?

At a first glance I would say no. The Acrobat Reader needs the path to
a file name as an argument. And how could we tell the Acrobat Reader
at what location in memory the file would start?!

But on a second glance, maybe there is a part of the Windows operating
system that has some kind of unique file name (or some kind of handle)
and allows some kind of a data stream. Just an idea.

Thanks in advance,
Wolfgang
Jul 10 '08 #4
wo************* **@gmail.com wrote:
I have a pdf document saved (as a base64 encoded string) in a remote
database. I now want to allow the client application to display that
document. Because of legal issues I am not allowed to temporarily save
the pdf document on the local hard disk.

My question: Is there a way in C# and the .net framework to display
the pdf document, say in the Acrobat Reader, without saving the pdf
file to hard disk?
You could use some kind of RAM disk, but this requires installing drivers.

--
Paul
Jul 10 '08 #5
On Jul 10, 3:30*pm, "Chakravart hy" <dskch...@msn.c omwrote:
Wolfgang,

First things first, it is not possible to stream the data to a PDF reader..

Secondly, if you have to invoke the PDF reader, there has to be a file.
thus, with out writing onto disk, you can't achieve this task.
This isn't quite correct - Windows allows to use named pipes in calls
to CreateFile, so, as long as a program doesn't try to seek the
stream, it should be able to read from / write to a named pipe. For
example, you can use "type" to read from a pipe. Then, .NET
application can use NamedPipeServer Stream to provide the data.

I very much doubt it would work with any PDF reader, though.
Jul 10 '08 #6
The only way I can think of is to have the source application send the
stream via HTTP to say, a WebBrowser control in the client app with the
correct Response.Conten tType. This would trigger the Acrobat Reader to come
up and display the PDF in the browser window.
Peter

<wo************ ***@gmail.comwr ote in message
news:c4******** *************** ***********@56g 2000hsm.googleg roups.com...
>I have a pdf document saved (as a base64 encoded string) in a remote
database. I now want to allow the client application to display that
document. Because of legal issues I am not allowed to temporarily save
the pdf document on the local hard disk.

My question: Is there a way in C# and the .net framework to display
the pdf document, say in the Acrobat Reader, without saving the pdf
file to hard disk?

At a first glance I would say no. The Acrobat Reader needs the path to
a file name as an argument. And how could we tell the Acrobat Reader
at what location in memory the file would start?!

But on a second glance, maybe there is a part of the Windows operating
system that has some kind of unique file name (or some kind of handle)
and allows some kind of a data stream. Just an idea.

Thanks in advance,
Wolfgang
Jul 10 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
4439
by: lothar | last post by:
re: 4.2.1 Regular Expression Syntax http://docs.python.org/lib/re-syntax.html *?, +?, ?? Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few characters as possible will be matched. the regular expression module fails to perform non-greedy matches as described in the documentation: more than "as few characters as possible"
5
3760
by: klaus triendl | last post by:
hi, recently i discovered a memory leak in our code; after some investigation i could reduce it to the following problem: return objects of functions are handled as temporary objects, hence their dtor is called immediately and not at the end of the function. to be able to use return objects (to avoid copying) i often assign them to a const reference. now, casting a const return object from a function to a non-const reference to this...
25
7669
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
32
4533
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
22
12067
by: Steve - DND | last post by:
We're currently doing some tests to determine the performance of static vs non-static functions, and we're coming up with some odd(in our opinion) results. We used a very simple setup. One class had a static function, and the one class had a non-static function. Both of these functions did the exact same thing. The test function: public void Test(){ decimal y = 2; decimal x = 3;
8
3522
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I cannot load/unload/reload extensions into my large and slow-to-load application during development without restarting the process then the disadvantages may outweigh the advantages. I've got a mixed-mode program in which I create a new AppDomain...
14
8485
by: Patrick Kowalzick | last post by:
Dear all, I have an existing piece of code with a struct with some PODs. struct A { int x; int y; };
2
6127
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my pointers, but I'm not sure. Please help. The code: void equate(matrix *A, matrix *B) { int i, j; assert(A.row_dim == B.col_dim && A.col_dim == B.col_dim); for(i=0; i < A.row_dim; i++) for(j=0; j < A.col_dim; j++)
399
12983
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or to python-3000@python.org In summary, this PEP proposes to allow non-ASCII letters as identifiers in Python. If the PEP is accepted, the following identifiers would also become valid as class, function, or variable names: Löffelstiel,...
12
29931
by: puzzlecracker | last post by:
is it even possible or/and there is a better alternative to accept input in a nonblocking manner?
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.