Click here to Skip to main content
15,886,963 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionIFrame Use Pin
Amit Patel198511-May-10 5:50
Amit Patel198511-May-10 5:50 
AnswerRe: IFrame Use Pin
Not Active11-May-10 8:52
mentorNot Active11-May-10 8:52 
AnswerRe: IFrame Use Pin
Venkatesh Mookkan11-May-10 17:54
Venkatesh Mookkan11-May-10 17:54 
GeneralRe: IFrame Use Pin
Amit Patel198511-May-10 20:16
Amit Patel198511-May-10 20:16 
QuestionRating control in asp.net Pin
trilokharry11-May-10 5:37
trilokharry11-May-10 5:37 
AnswerRe: Rating control in asp.net Pin
Sandeep Mewara11-May-10 6:27
mveSandeep Mewara11-May-10 6:27 
QuestionSaving file into database as binary Pin
Deb_2611-May-10 5:22
Deb_2611-May-10 5:22 
AnswerRe: Saving file into database as binary Pin
michaelschmitt11-May-10 6:16
michaelschmitt11-May-10 6:16 
Hi,

without viewing at your code, it is difficult to decide where the problem is. I'm doing the same
thing with itextsharp and a mysql db in some project. Here is how i basically do it:
// Open ITextSharp Document and memstream
Document myDocument = new Document(PageSize.A4);

MemoryStream mstream = new MemoryStream();
             
PdfWriter.GetInstance(myDocument, mstream );

myDocument.Open();
  
// Do some itextsharp stuff to myDocument
  
  
// Close Document 
myDocument.Close();

// Save stream to byte[] and save that byte[] to your db
byte[] fileData = mstream.GetBuffer();

// ...database-saving-logic....



As you're posting this in the asp.net forum, i suppose you want to write this pdf to your reponse stream? (or to file?!)

This is how i write it to response-stream in page-load of a download page
(you have to replace mimeType, fileName, fileSize and fileData by your own variables/strings - with
fileData being the byte[] and filesize the length of that byte[]):

Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = mimeType; // (guess it's "application/pdf")

Response.AppendHeader("content-disposition", "attachment; filename=" +
HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.AppendHeader("content-length", fileSize.ToString());
Response.BinaryWrite(fileData);
Response.End();



Hope this helps. If you've problems writing/reading this data from/to a file, let me know.
QuestionMigrating ASP.NET 1.1 web app from IIS 6 (WinServer2003 environment) to IIS 7 (WinServer2008 environment) Pin
Tobygm11-May-10 4:38
Tobygm11-May-10 4:38 
QuestionSMTP Server Pin
Dhyanga11-May-10 3:48
Dhyanga11-May-10 3:48 
AnswerRe: SMTP Server Pin
Peace ON11-May-10 4:18
Peace ON11-May-10 4:18 
GeneralRe: SMTP Server Pin
Dhyanga11-May-10 4:28
Dhyanga11-May-10 4:28 
GeneralRe: SMTP Server Pin
Peace ON11-May-10 4:53
Peace ON11-May-10 4:53 
QuestionWeb Service Connection Pin
#realJSOP11-May-10 3:35
mve#realJSOP11-May-10 3:35 
AnswerRe: Web Service Connection Pin
Peace ON11-May-10 4:29
Peace ON11-May-10 4:29 
Question"Time Out Expire" problem Pin
souravghosh1811-May-10 2:44
souravghosh1811-May-10 2:44 
AnswerRe: "Time Out Expire" problem Pin
Peace ON11-May-10 2:54
Peace ON11-May-10 2:54 
GeneralRe: "Time Out Expire" problem Pin
souravghosh1811-May-10 3:33
souravghosh1811-May-10 3:33 
AnswerRe: "Time Out Expire" problem Pin
Peace ON11-May-10 4:15
Peace ON11-May-10 4:15 
QuestionGetting client IP/MAC address - NOT server address Pin
xavier999911-May-10 1:53
xavier999911-May-10 1:53 
AnswerRe: Getting client IP/MAC address - NOT server address Pin
Peace ON11-May-10 2:03
Peace ON11-May-10 2:03 
AnswerRe: Getting client IP/MAC address - NOT server address Pin
Michel Godfroid11-May-10 2:32
Michel Godfroid11-May-10 2:32 
QuestionAjax Control ToolKit Error Pin
kushMuchaal11-May-10 1:44
kushMuchaal11-May-10 1:44 
AnswerRe: Ajax Control ToolKit Error Pin
Brij11-May-10 1:49
mentorBrij11-May-10 1:49 
GeneralRe: Ajax Control ToolKit Error Pin
kushMuchaal11-May-10 19:07
kushMuchaal11-May-10 19:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.