Telerik PdfProcessing in Creator in PDF Export of Datagridview

1 Answer 88 Views
GridView
Maninder
Top achievements
Rank 1
Maninder asked on 07 Dec 2022, 11:51 AM

Hi

How to remove or edit "Creator Telerik PdfProcessing" text before exporting DGV to pdf from PDF Properties.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Dec 2022, 01:03 PM

Hi, Maninder,

According to the provided information, it is not clear what is the exact setup that you have on your end with RadGridView. Could you please elaborate? However, I would recommend you to have a look at the GridViewPdfExport and the export capabilities it offers: https://docs.telerik.com/devtools/winforms/controls/gridview/exporting-data/export-to-pdf 

In case you are still experiencing any further difficulties, it would be greatly appreciated if you can specify more details about the specific case and how to reproduce it locally.

Thank you in advance for your cooperation.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Maninder
Top achievements
Rank 1
commented on 07 Dec 2022, 01:10 PM

I have successfully exported pdf using pdfexporter from radgridview.

When I open pdf in any viewer and view its properties, there is a metadata (like author, title, description) called Creator and its value is "Telerik PdfProcessing". I want to change or remove this property

 
Dess | Tech Support Engineer, Principal
Telerik team
commented on 08 Dec 2022, 11:26 AM

Hello, Maninder,  

The GridViewPdfExport object utilizes the powerful RadPdfProcessing library and exports RadGridView`s data natively to the PDF format. That is why the document info may state that Telerik RadSpreadProcessing has created the exported file. Note that once the pdf document is generated, you can use the output file and load it with the help of RadPdfProcessing where you can specify the RadFixedDocument.DocumentInfo according to your needs: 

            Telerik.WinControls.Export.GridViewPdfExport pdfExporter = new Telerik.WinControls.Export.GridViewPdfExport(this.radGridView1); 
            pdfExporter.FileExtension = "pdf";
            string fileName = @"..\..\ExportedData" + DateTime.Now.ToLongTimeString().Replace(":", "_") + ".pdf";
            pdfExporter.RunExport(fileName, new Telerik.WinControls.Export.PdfExportRenderer());
             
            PdfFormatProvider provider = new PdfFormatProvider(); 
            using (Stream stream = File.OpenRead(fileName)) 
            { 
                RadFixedDocument document = provider.Import(stream);  

                document.DocumentInfo.Author = "My author";
                document.DocumentInfo.Description = "My description";
                document.DocumentInfo.Title = "My title";
                
                using (Stream output = File.OpenWrite(@"..\..\output.pdf")) 
                { 
                    provider.Export(document, output); 
                }
                
            }

Then you can export to a new file with the applied changes. If you have any further question about RadPdfProcessing and how to manipulate the pdf file, you can refer to the relevant online documentation: https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/overview 

Tags
GridView
Asked by
Maninder
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or