This is a migrated thread and some comments may be shown as answers.

help me!!RadGrid Export to Pdf,and open the Pdf file,need the password

6 Answers 216 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 12 Jun 2010, 04:53 AM
I used RadGrid  Export to Pdf and open the PDF file,but need the password,why?
code:

  protected void ToPdf_Click(object sender, ImageClickEventArgs e)
        {
            gvStudent.PageSize = 50;
            gvStudent.ExportSettings.IgnorePaging = true;
            gvStudent.ExportSettings.OpenInNewWindow = true;
            gvStudent.MasterTableView.ExportToPdf();
        }
 

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Jun 2010, 09:11 AM
Hello Bob,

This problem is addressed in RadControls for ASP.NET AJAX Q1 2010 SP1.
Let me know if you need more information.

Best regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ugur
Top achievements
Rank 1
answered on 26 Jan 2011, 09:24 AM
Hi,
I have same issue. After created pdf, it asks for password although I didn't set any property related with password.
I have 2010.3.1317.35 version of Telerik.Web.UI.dll installed (last updated). I want to save pdf in a directory and send it with mail without showing it.
Please help !

protected

 

 

void grdResult_GridExporting(object source, GridExportingArgs e)
{
if (File.Exists(path))
{
File.Delete(path);
}
using (FileStream fs = File.Create(path))
{
Byte[] info = System.Text.Encoding.Default.GetBytes(e.ExportOutput);
fs.Write(info, 0, info.Length);
}
Response.Redirect(
"~/Default.aspx");  }

 

0
Daniel
Telerik team
answered on 26 Jan 2011, 10:29 AM
Hello Ugur,

The Default encoding is the root cause for this issue. Try the following:
Encoding.GetEncoding(1252).GetBytes(...

Regards,
Daniel
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Ugur
Top achievements
Rank 1
answered on 26 Jan 2011, 10:40 AM
Thanks,
it works..
0
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
answered on 01 Feb 2016, 08:31 AM

HI

 

Encoding.GetEncoding(1252) is works for none-DBCS only.

Consider the DBCS too Okay.

 

So, How to resolve the DBCS, Encoding.GetEncoding(950), etc. the exported pdf still password protected.

 

Best regards.

 

Chris

 

 

0
Daniel
Telerik team
answered on 02 Feb 2016, 03:35 PM
Hello Chris,

 The problem is most probably a broken header of the PDF file which may be caused by different factors. For example:
- postback compression in IIS or RadCompression
- changes to the binary array
- SSL + Internet Explorer
To get better assistance, please let us know what are your browser/version and share the corresponding code so that we can examine it.

I have attached a simple website (add a web.config and binary files to run it) which you could test at your side. The first button saves the output to the file then sends the file to the browser. The second one sends the output directly to the browser. RadGrid is bound to a simple DataTable with multi-byte character text (japanese and chinese) for testing purposes.

Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ugur
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
Share this question
or