PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sending Document object to IE

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
Sawan



Joined: 12 Sep 2007
Posts: 7

PostPosted: Wed Sep 12, 2007 6:10 am    Post subject: Sending Document object to IE Reply with quote

Hi,

I'm using PDFSharp for filling the PDF forms.

My Query is:
I have assigned some value to any field of the acro form and now I want to pass the document object to IE to show the same pdf object using response.

So, how can I send the document object to IE to open it as PDF?
How can I convert the document object to Byte[] stream?

Thanks in Advance.

Regards,
Sawan
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Wed Sep 12, 2007 8:02 am    Post subject: Reply with quote

Hi!
Please check the Clock sample in the PDFsharp\WebSamples folder.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Sawan



Joined: 12 Sep 2007
Posts: 7

PostPosted: Wed Sep 12, 2007 10:24 am    Post subject: One more Help needed Reply with quote

Hi Thomas,

Thanks for replying.

It works for me now. But the problem is, its opening the PDF in Mozilla but not in IE.

Also if i'm trying to come out from one more problem.

When I use the use PdfDocumentOpenMode.Modify its not showing the value of forms fields in pdf. but it shows only when use as PdfDocumentOpenMode.ReadOnly.

And ReadOnly throws an error when I tries to save the document object to stream.

Thanks in Advance again.

Regards,
Sawan
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Wed Sep 12, 2007 11:44 am    Post subject: Reply with quote

It seems there is a solution for the IE problem:
Click here
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Sawan



Joined: 12 Sep 2007
Posts: 7

PostPosted: Wed Sep 12, 2007 12:30 pm    Post subject: IE Problem... Reply with quote

Hi Thomas,

I have written the same line of except some datatype conversion code but it still having the same problem and I'm using Acrobat Professional6.0.

Your Suggestion:
Response.AddHeader("Accept-Header", stream.Length);
Response.AddHeader("Content-Length", stream.Length);
Response.OutputStream.Write(stream.GetBuffer(), 0, stream.Length);
Response.Flush();
Response.End();
stream.Close();


My Code:
Response.ContentType = "application/pdf";
Response.AddHeader("Accept-Header", stream.Length.ToString()); --- converting int to string
Response.AddHeader("content-length", stream.Length.ToString()); --- converting int to string
int i = (int)stream.Length; --- Converting long to int
Response.OutputStream.Write(stream.GetBuffer(), 0, i);

Regards,
Sawan
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Wed Sep 12, 2007 2:03 pm    Post subject: Reply with quote

Our code in the WebClock sample:
Code:
  // Send PDF to browser
  MemoryStream stream = new MemoryStream();
  document.Save(stream, false);
  Response.Clear();
  Response.ContentType = "application/pdf";
  Response.AddHeader("content-length", stream.Length.ToString());
  Response.BinaryWrite(stream.ToArray());
  Response.Flush();
  stream.Close();
  Response.End();

This code works with IE (at least on our computers).

I referred you to the topic on this forum because some people complained that this code was not working. (I admit I didn't test the solution suggested in that thread.)
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Sawan



Joined: 12 Sep 2007
Posts: 7

PostPosted: Wed Sep 12, 2007 3:50 pm    Post subject: Reply with quote

Hi Thomas,

Thank you for replying. But again the code is not working for me.

I'm also stucked at one more problem(which I posted in my last reply) and hope some positive reply from you.

Problem:
Also if i'm trying to come out from one more problem.

When I use the use PdfDocumentOpenMode.Modify its not showing the value of forms fields in pdf. but it shows only when use as PdfDocumentOpenMode.ReadOnly.

And ReadOnly throws an error when I tries to save the document object to stream.


Again Thanks in Advance.

Regards,
Sawan
Back to top
View user's profile Send private message
Sawan



Joined: 12 Sep 2007
Posts: 7

PostPosted: Wed Sep 12, 2007 4:02 pm    Post subject: Message from IE Reply with quote

Hi Thomas,

I just did right click on IE where the PDF is not shown. its showing the following message. "The XML source file is unavailable for Viewing."

Hope this can help.

Regards,
Sawan
Back to top
View user's profile Send private message
Sawan



Joined: 12 Sep 2007
Posts: 7

PostPosted: Fri Sep 14, 2007 9:57 am    Post subject: any Update Reply with quote

Hi Thomas,

Can you please provide any solution for this problem?

Regards,
Sawan
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com