473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1579
>
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.comwrote in message
news:c4**********************************@56g2000h sm.googlegroups.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, "Chakravarthy" <dskch...@msn.comwrote:
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 NamedPipeServerStream 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.ContentType. This would trigger the Acrobat Reader to come
up and display the PDF in the browser window.
Peter

<wo***************@gmail.comwrote in message
news:c4**********************************@56g2000h sm.googlegroups.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
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...
5
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...
25
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
32
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
22
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...
8
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...
14
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
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...
399
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...
12
by: puzzlecracker | last post by:
is it even possible or/and there is a better alternative to accept input in a nonblocking manner?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.