Creating a PDF

J

jmrasmus

I am trying to create a PDF file in C# .NET from a string. Here is my
code...

Encoding unicode = Encoding.Unicode;
byte[] unicodeBytes = unicode.GetBytes(sBuffer);

Response.BinaryWrite(unicodeBytes);
Response.End();

where sBuffer is a string.


I am getting an Acrobat error that states the file is corrupted and
cannot be repaired.

Can anyone please help, I have been stuck on this for days.

TIA

Jim
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

What are you using to create the pdf?
You need some third party tool or control that generate the PDF file.
 
J

jmrasmus

Hi,

What are you using to create the pdf?
You need some third party tool or control that generate the PDF file.




I am trying to create a PDF file in C# .NET from a string. Here is my
code...
Encoding unicode = Encoding.Unicode;
byte[] unicodeBytes = unicode.GetBytes(sBuffer);
Response.BinaryWrite(unicodeBytes);
Response.End();

where sBuffer is a string.
I am getting an Acrobat error that states the file is corrupted and
cannot be repaired.
Can anyone please help, I have been stuck on this for days.

Jim- Hide quoted text -

- Show quoted text -

Sorry, PDFLib
 
R

rossum

I am trying to create a PDF file in C# .NET from a string. Here is my
code...

Encoding unicode = Encoding.Unicode;
byte[] unicodeBytes = unicode.GetBytes(sBuffer);

Response.BinaryWrite(unicodeBytes);
Response.End();

where sBuffer is a string.


I am getting an Acrobat error that states the file is corrupted and
cannot be repaired.

Can anyone please help, I have been stuck on this for days.

TIA

Jim
Unicode != PDF. PDF is a specific file format for Adobe Acrobat
compatible files. See
http://www.adobe.com/devnet/pdf/pdf_reference.html for details.

rossum
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top