We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save() creates corrupt PDF (.NET 2.0)

Thread ID:

Created:

Updated:

Platform:

Replies:

49978 Oct 3,2006 05:43 AM UTC Jun 19,2007 04:19 AM UTC ASP.NET Web Forms (Classic) 7
loading
Tags: PDF
Administrator [Syncfusion]
Asked On October 3, 2006 05:43 AM UTC

Just downloaded and installed. Running on local machine (localhost), running your Hello World example:

Export.CreatePDF(int.Parse(RentalPropertyId), Response);
PDFDocument pdfDoc = new PDFDocument();
IPDFFont pdfFont = pdfDoc.Fonts.Add(FontBaseFamily.TimesRoman);
IPDFPage firstPage = pdfDoc.Pages[0];
firstPage.Graphics.DrawText(0, 0, "Hello World!", pdfFont);
pdfDoc.Save("Sample.pdf", Response, HttpReadType.Save);

The file is corrupt. Adobe Reader v7.0 reports:
"The file is damaged and cannot be repaired."

Please advise. Thank you.

Sample70.zip

Administrator [Syncfusion]
Replied On October 3, 2006 06:10 AM UTC

Nevermind. I figured it out. If you have @Page Trace="true" then you get all the tracing output tacked onto the pdf which renders it useless. Even explicitly clearing the Response before calling Save() and calling Response.End() after the save won''t fix. It appears ASP.NET tacks on the tracing output even after Response.End() is called.

Sean

Rudy Bruning
Replied On February 27, 2007 04:22 PM UTC

I have the same problem.. what did you do to correct this?

Thnx,

Rudy

>Nevermind. I figured it out. If you have @Page Trace="true" then you get all the tracing output tacked onto the pdf which renders it useless. Even explicitly clearing the Response before calling Save() and calling Response.End() after the save won't fix. It appears ASP.NET tacks on the tracing output even after Response.End() is called.

Sean

Administrator [Syncfusion]
Replied On February 27, 2007 04:26 PM UTC

I use this save :
Stream pdfData = new MemoryStream();
pdfDoc.Save(pdfData);

>I have the same problem.. what did you do to correct this?

Thnx,

Rudy

>Nevermind. I figured it out. If you have @Page Trace="true" then you get all the tracing output tacked onto the pdf which renders it useless. Even explicitly clearing the Response before calling Save() and calling Response.End() after the save won't fix. It appears ASP.NET tacks on the tracing output even after Response.End() is called.

Sean

Kathy Gray
Replied On June 15, 2007 07:03 PM UTC

How do you open it then in the browser?

>I use this save :
Stream pdfData = new MemoryStream();
pdfDoc.Save(pdfData);

>I have the same problem.. what did you do to correct this?

Thnx,

Rudy

>Nevermind. I figured it out. If you have @Page Trace="true" then you get all the tracing output tacked onto the pdf which renders it useless. Even explicitly clearing the Response before calling Save() and calling Response.End() after the save won't fix. It appears ASP.NET tacks on the tracing output even after Response.End() is called.

Sean

Melba Winshia [Syncfusion]
Replied On June 18, 2007 12:31 PM UTC

Hi Kathy,

Could you please let us know if you are also facing the error "The file is damaged and cannot be repaired" while running our Hello World example? This would help us to analyze this issue further.

Thanks,
Melba

Kathy Gray
Replied On June 18, 2007 04:55 PM UTC

I'm glad you asked, because the issue I was having was not on my computer, but on our server. When I tried the hello world sample on the server, I was able to see what the problem was. Apparently, when I save the document, it requires the Syncfusion.Compression.Base.dll. It's odd, since I don't have to reference that dll in my project.

So, anyone else who may be having this problem, try adding Syncfusion.Compression.Base.dll to your bin folder.

-Kathy

>Hi Kathy,

Could you please let us know if you are also facing the error "The file is damaged and cannot be repaired" while running our Hello World example? This would help us to analyze this issue further.

Thanks,
Melba

Melba Winshia [Syncfusion]
Replied On June 19, 2007 04:19 AM UTC

Hi Kathy,

Glad to hear that issue is resolved by adding Syncfusion.Compression.Base.dll.

Note:
-----

You need to include the following assemblies during deployment

Syncfusion.Compression.Base.dll
Syncfusion.core.dll
Syncfusion.Shared.Base.dll
Syncfusion.DLS.Base.dll
Syncfusion.pdf.base.dll

Kindly let me know if you have any other questions.

Thanks,
Melba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;