• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

Appending images in memory

I am writing an aspnet page that gives the user a link to view the data's associated image.  Due to the size of these images, we have broken them down from one large file with 4 pages, to 4 files with 1 page.  They are managed via a file structure.  For instance:

        FolderABC
            ABC1.pdf
            ABC2.pdf
            ABC3.pdf
            ABC4.pdf

When the user clicks on the link, I wish for Adobe to display all four pdfs as if they were one, so they can click and page through it.  I do not want to create a temp file and append to it so I can work with it that way.  Also I don't wish to embed the image inside of web page, because would like the native apps like Adobe or Windows Picture and Fax viewer to open my images.  Is there a way to loop through the folder and append files in memory and then pass it as an argument to perhaps proc.StartInfo.FileName = fileInMemorySomewhere?  Suggestions welcome.  thanks



string pathFilename = "";
Process proc = new Process();
proc.StartInfo.FileName = pathFilename;
proc.Start();

Open in new window

0
SpokaneISD
Asked:
SpokaneISD
1 Solution
 
tcullerCommented:
Unfortunately, as far as I know, the way the programs you want to use work require the image to be on your hard-disk, not in memory. I may be mis-understanding what you mean, but here's an example of how you would go about starting the files in the ABC example you gave. You'd call this function, passing the full path to your FolderABC, which would then find all files with the .pdf extension in the top level of that directory (the third parameter gives you the option of either recursively searching the folder, or just a top-level search, which I have excluded).
void ViewAllPictures(System.String pathToFiles)
{
     foreach(System.String file in
          System.IO.Directory.GetFiles(pathToFiles, "*.pdf"))
     {
          // Just call the static method Start instead of
          // creating a new Process instance, unless you have
          // a reason to maintain a reference to the process.
          System.Diagnostics.Process.Start(file);
     }
}

Open in new window

0
 
SpokaneISDAuthor Commented:
I was hoping to be able to loop through the files in my directory and displaying them without saving them on hard-disk, but getting the process to "pretend" all the files were actually one file, so they could click next-page, previous-page, and so on.  Looks like I may have to embed them into a browser window.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now