PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 16, 2024 6:24 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue May 01, 2012 2:06 pm 
Offline

Joined: Tue Nov 08, 2011 12:24 pm
Posts: 22
Hello!

I have a question about opening the pdf in a new window. I have the following code and it works great but from the UI it opens the doc in the same window so I wanted to know if I can fix it to open in a new window?

MemoryStream stream = new MemoryStream();
document.Save(stream, false);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-length", stream.Length.ToString());
HttpContext.Current.Response.BinaryWrite(stream.ToArray());
HttpContext.Current.Response.Flush();
stream.Close();

Thanks a lot!

-tulips


Top
 Profile  
Reply with quote  
PostPosted: Wed May 02, 2012 6:17 am 
Offline

Joined: Thu Apr 26, 2012 10:28 am
Posts: 4
Location: StP
I think you better dig up client side (HTML code)... Use window.open method in case of JS or specify target="_blank" in plain HTML.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 181 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group