Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-1 votes
2 answers
103 views

What are the alternatives to using a MemoryStream twice here?

I'm trying to write code that stamps a passport with the system users name, date and an image of their signature (which I store as a varbinary in the sql database and byte in the model). Here is my ...
William Sewell's user avatar
0 votes
0 answers
43 views

WPF How to show a MemoryStream PDF document to a WebBrowser

I cant show a pdf document save it in a database table direcly to a WebBrowser using a MemoryStream. I have a DataBase with pfd documents saved in a table filed, and I want to show the pdf document ...
Francisco Lopez's user avatar
2 votes
2 answers
536 views

C# Merging multiple memory streams and returning via filestreamresult, showing only last memory stream

I am trying to merge multiple pdf files into one memory stream and return it with FileStreamResult to web application. My code is like that: string contentType = "application/pdf"; ...
SmolkoMatic's user avatar
0 votes
1 answer
1k views

How to read from byte using ITextSharp PDFReader?

I have the method below that fills in data into a pdf: public Stream FillDataIntoPDF(){ var pdfTemplate = _fileService.GetFileInfo(pdfFilePath); Stream outStream = new ...
avdeveloper's user avatar
2 votes
2 answers
14k views

iText 7 and C# writing a PDF file from MemoryStream?

I have a PDF document (using iText 7/C# 4.01) that I am creating in a MemoryStream and at the end, I want to write it out to a file. Part of the reason I am creating it in a memory stream is that I ...
adveach's user avatar
  • 75
1 vote
1 answer
2k views

Create Memorystream of type pdf and return to browser

I have to create a blank PDF with a simple text message and return it to the browser. I don't have to use any third-party PDF library like iTextSharp, PDFDocument, etc. I am using MemoryStream but a ...
SSD's user avatar
  • 1,227
0 votes
0 answers
2k views

PDFium - create PDF document from image stream without converting to Bitmap in c#

I am working with PDFium c# tool to create PDF document from PNG image stream. I have an API which gets multiple image stream objects, I should combine the image streams and create a PDF document and ...
Dangerous Dev's user avatar
0 votes
0 answers
16 views

Getting wrong size of pdf file by mail

I am sending a pdf file size 278kb but I'm getting a file size 5 kb that I can't open... I don't understand where is the problem... this is my code : MailMessage oMail = new MailMessage(); ...
Damkulul's user avatar
  • 1,476
0 votes
1 answer
59 views

Unable to evaluate expression error while trying to display PDF using memorystream

I'm trying to generate PDF of my SharePoint page but keep getting an "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack." error. Am I ...
DanielJ's user avatar
  • 61
0 votes
0 answers
347 views

Itextsharp SetField not replacing the text as expected in mail attachment .Net C# core

I have a pdf template with below content First Name: {{FirstName}} Contact Number: {{ContactNumber}} Email Id: {{EmailId}} Address 1: {{Address1}} Address 2: {{Address2}} Qualification: {{...
Nidhin Paul's user avatar
0 votes
1 answer
845 views

PDF file is not get generating properly in C# .net core project from MemoryStream

I have below code to create a pdf file To read contents i used String path = System.IO.Directory.GetCurrentDirectory() +Path.DirectorySeparatorChar.ToString() + "Templates&...
Nidhin Paul's user avatar
0 votes
0 answers
377 views

CopyToAsync() dont' fill the memory stream

i'm using xamarin.forms app and need to save file(it this situation pdf file). This is my scenario: I'm using media plugin to save images with camera and from that images with PdfDocument object i ...
Razzzz's user avatar
  • 391
0 votes
1 answer
1k views

zip multiple pdfs from url link, how to

I have a project that requires pdf files to be zipped up from an URL link and then downloaded and clickable by the end users browser. So far, I was able to zip one pdf file which isn't nearly what I'm ...
Chris H.'s user avatar
  • 151
0 votes
1 answer
533 views

PDF File Zip in Memory Stream Showing not supported file or damaged My Code attached

I have pdf file in directory that can be open successfully. I am actually changing into byte[] and zip it in memory stream and return it. I got all files as zipped but when i am opening files getting ...
Doc's user avatar
  • 179
-1 votes
2 answers
15k views

c# how to save IO.Stream to MemoryStream and save to PDF file on local folder

I am calling a third party service, which return a pdf file by IO.Stream. I need to change to MemoryStream, and save to a pdf file.
zmaggie's user avatar
  • 264
0 votes
0 answers
551 views

Replacing a String in byte[] pdf file using c#

I'm downloading a pdf file from FTP server. I need to find a string and replace it, but when I try to convert the byte[] to string. It returns a non sense string. WebClient client = new WebClient(); ...
Code Guy's user avatar
  • 105
0 votes
1 answer
346 views

TallComponents.PDF.Document Error: "the document is corrupt, rebuilding failed"

I'm getting exception "the document is corrupt, rebuilding failed", while instantiating TallComponents.PDF.Document from MemoryStream. The byteResponse is good. that is, the document is NOT Corrupted....
Swapnil's user avatar
  • 37
1 vote
1 answer
9k views

Response PDF download from base64string c#

I'm trying to do an API for downloading PDF, what I did is like so: HttpResponseMessage result = new HttpResponseMessage(); MemoryStream stream = new MemoryStream(); try { var base64 = "..."; ...
Dean's user avatar
  • 678
1 vote
0 answers
528 views

Copy MemoryStream of a pdf from file to a MemoryStream created from PdfPTable

I'm trying to create a two page PDF that contains: 1)A 2x2 W2 on one page, this portion is correct; 2)(new)the instructions for the first page, this portion is not working. Currently this code runs ...
jigglymig TheMighty's user avatar
0 votes
0 answers
370 views

When trying to convert an HTML file to a PDF file my program seems to hang at pdf.save(ms)

I have two programs, one that writes an html file based on data in SQL DB (this works fine) After the file is saved, the following program should pick it up and convert it to PDF for the 1st program ...
Brian Botha's user avatar
1 vote
1 answer
14k views

How to concatenate two byte arrays

i use this method to merge existing pdf documents and add new pdf documents to it (in memory not physical) the problem i have 2 memory stream one for merged pdf and one to the new document then ...
manal's user avatar
  • 13
0 votes
2 answers
1k views

Can't copy PDF File from MemoryStream to FileStream

Am i doing anything wrong? May i ask why can't i open both pdfs file saved? As for MemoryStream it is saved to my directory -> Downloads Folder from Chrome and for FileStream it is saved to the ...
domster's user avatar
  • 566
0 votes
0 answers
30 views

PDF doesn't Download itextsharp [duplicate]

This is my code, don't have any error but page doesn't does nothing. I don't know where is the error, please help :O Dim documentoPDF As New Document(PageSize.A4, 10, 10, 10, 10) Dim ...
Leonardo Peyretti's user avatar
0 votes
1 answer
1k views

Programmatically Attach PDF from MemoryStream to Outlook E-Mail Items

Would it be possible to attach PDF from MemoryStream or other functions to Outlook E-Mail Items MailItem.Attachment.add(), rather than from the file on the hard disk by passing the physical path of ...
angwong's user avatar
  • 31
0 votes
2 answers
2k views

Copy Response.OutputStream to MemoryStream

How can I copy Response.Outputstream to MemoryStream? The error is: Stream does not support reading. And here is the code: string pdfTemplate = Server.MapPath(@"~\Pdf\132331.pdf"); Response....
Joseph's user avatar
  • 671
0 votes
0 answers
2k views

How to open PDF file in default reader using MemoryStream

I want to open a PDF file from a MemoryStream. I am using this code System.Diagnostics.Process.Start(filepath); In the above code if I pass the file path as a argument, then it works fine and my ...
Jatin Gadhiya's user avatar
1 vote
0 answers
3k views

How to make a PDF on memory and send it to browser

I want to make a PDF from a HTML string on memory and send it to a browser. I don't want to save a file on the server so I'm using the following code. I'm also using ITextSharp. string thistopdf = "&...
Franco Fittipaldi's user avatar
2 votes
2 answers
8k views

How to memory stream a pdf to a HTML Object

My objective is to display a PDF in a html-<object> from a memory stream. From C# code behind I can get a PDF from a Memory Stream to display in a browser like this, This will effectively ...
Ray's user avatar
  • 480
2 votes
1 answer
8k views

ITextSharp - using PdfStamper resulting MemoryStream to close

I'm using ITextSharp to split multi-page PDF files into single page files. I also managed to add those single page PDFs to a zip file using MemoryStream. Now, I need to add password protection to ...
Arman's user avatar
  • 1,442
0 votes
0 answers
377 views

File.ReadAllBytes not creating an exact copy of my PDF - changing my mailto: link url

I'm dynamically creating a PDF file using ABC PDF v8, then pushing that data to the screen using the File.ReadAllBytes method, then displaying it using MVC5's FileStreamResult from my controller. The ...
someguy0005's user avatar
3 votes
3 answers
7k views

How to insert a dynamically generated bitmap into PDF document using PDFsharp?

I am trying to use PDFsharp to insert a dynamically generated bitmap of a QR Code in to a PDF document. I don't want to save the bitmap to the file but just want to insert it into the PDF. The ...
user2789697's user avatar
0 votes
0 answers
654 views

Highlight keywords in a pdf using itextsharp and render it to the browser

I have an existing pdf .I am using itextSharp to open the document and highlight keywords dynamically and when I save this into a file it works fine, but when I write it into a memory Stream and try ...
Poulami's user avatar
6 votes
1 answer
26k views

Read a stored PDF from memory stream

I'm working on a database project using C# and SQLServer 2012. In one of my forms I have a PDF file with some other information that is stored in a table. This is working successfully, but when I want ...
Hunar's user avatar
  • 399
30 votes
1 answer
33k views

Getting PdfStamper to work with MemoryStreams (c#, itextsharp)

It came to me to rework old code which signs PDF files into new one, which signs MemoryStreams (byte arrays) that come and are sent by web services. Simple, right? Well, that was yesterday. Today I ...
ADSMarko's user avatar
  • 363
1 vote
2 answers
1k views

Create PDF file thru an online text editor and save it directly to the web server filesystem ASP.NET MVC

Hi my question is this possible? I am currently using TinyMce and Itextsharp to create a pdf file but my problem is when I save it requires to be saved in the client's pc which is not needed I only ...
StackOverlord's user avatar
0 votes
2 answers
1k views

render pdf from memorystream

I have searched for entire day for a solution, but somehow I couldn't find it. What I wanted is to get data from database (binary file such as PDF) into MemoryStream (which I succeeded to do so), but ...
dovla110010101's user avatar
0 votes
1 answer
268 views

itextsharp pdfsmartcopy only returning last page

I have an issue where only the last page of my pdf is stored. The pdf should be multiple pages long, and this works fine if I just send the pdf to the browser using Response and the mms memory stream,...
dave's user avatar
  • 1,430
0 votes
1 answer
2k views

Generating PDF byte array

I have a static method like this and I am using ITextSharp to generate PDF.. public static byte[] createPDF(string htmlstr) { var html = @"<?xml version=""1.0"" encoding=""UTF-8""?>...
shress1's user avatar
2 votes
1 answer
12k views

open byte array from memory stream in new tab or window

This seems to be a common problem but after a lengthy search I have yet to find a solution that fits my needs. I am using itextsharp to fill out a pdf form from which i create a byte array. (There ...
ovaltein's user avatar
  • 1,205
0 votes
1 answer
575 views

Merge two pdf memorystreams from PDFStampers into one memorystream w/ 2 pages

This is my first experience with iText5 for .NET, and so far has been quite successful, except for one task. I have created two VB.Net classes, each which successfully returns a valid MemoryStream ...
Jose Cunha's user avatar
4 votes
3 answers
3k views

C# Appending Pdf Pages through MemoryStream

I'm currently working on some reports and need to append several reports in one PDF. In order to do so I'm using ReportViewer to get the reports in different byte[]. Once I have all the reports in a ...
Miguel Arvelo's user avatar
2 votes
2 answers
10k views

.NET Web Browser Control using in memory data

I have some binary data in memory (which represents a PDF file). What I’d like to be able to do is to point the standard .NET browser control directly to this data. For example: myLib mylib = new ...
Paul Michaels's user avatar
10 votes
5 answers
33k views

iTextSharp + FileStream = Corrupt PDF file

I am trying to create a pdf file with iTextSharp. My attempt writes the content of the pdf to a MemoryStream so I can write the result both into file and a database BLOB. The file gets created, has a ...
Norbert's user avatar
  • 4,291
3 votes
1 answer
16k views

C# 3.0 Save itextsharp pdf to database using MemoryStream

I'm trying to save to databse a pdf file generated by itextsharp. But, I haven't been successfully so far. I'm using Linq to sql. Here's the code: MemoryStream ms = new MemoryStream(); ...
André Miranda's user avatar
10 votes
2 answers
10k views

How to set the name of the file when streaming a Pdf in a browser?

Not sure exactly how to word this question ... so edits are welcomed! Anyway ... here goes. I am currently use Crystal Reports to generated Pdfs and just stream the output to the user. My code ...
mattruma's user avatar
  • 16.7k