PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Sep 17, 2021 12:48 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Feb 25, 2021 4:42 am 
Offline

Joined: Thu Feb 25, 2021 4:34 am
Posts: 2
In the examples to render a .pdf, it shows:

using (Process myProcess = new Process())
{
myProcess.StartInfo.FileName = fileName;
myProcess.Start();
}

This works fine when I render a document and create a file. However, I can't create files on our server so need to pass in a MemoryStream. How can this be accompished?


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 25, 2021 10:29 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 659
Location: CCAA
altyrocks wrote:
However, I can't create files on our server so need to pass in a MemoryStream. How can this be accompished?
You cannot create files on the server, but you can create processes on the server? Who will see the Adobe Reader window on the server?
Are you sure you ask the right question or try the right methods?

You have to pass the PDF to Adobe Reader and I don't think AR supports MemoryStreams for this.
Your code should be able to create temporary files on the server.
But do you really want to run that code on the server?

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 28, 2021 1:20 am 
Offline

Joined: Thu Feb 25, 2021 4:34 am
Posts: 2
The server is locked down for creating files. What I ultimately need is a Save Dialog Box to be able to generate and save the .pdf to a local computer. I'm not sure if this is possible because a server doesn't know about a user's local drive I'm assuming. This is really my first attempt at trying to use PDFsharp and MigraDoc.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 01, 2021 1:49 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 659
Location: CCAA
The server sends the PDF to the browser - a MemoryStream is fine at this stage.

The browser will then prompt to save the file on the local computer or display it in the browser - depending on the content disposition sent by the server.
The server cannot launch the file.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group