XDoc.PDF
Features
Tech Specs
How-to C#
How-to VB.NET
Pricing
C# PDF: How to PDF Create PDF Export File and Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print WPF Viewer & Editor Work with Other SDKs Barcode Read Barcode Create OCR Twain
Metadata: Edit, Delete Metadata
  |  
Home ›› XDoc.PDF ›› C# PDF: Edit PDF Metadata

C#.NET PDF SDK - Edit PDF Document Metadata in C#.NET


Allow C# Developers to Read, Add, Edit, Update and Delete PDF Metadata in .NET Project




Professional PDF SDK for adobe PDF document metadata editing in C# .NET framework


Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint


Evaluation library and components provide varieties of functionalities to edit and update PDF metadata in .NET WinForms and ASP.NET


C# source code for retrieving and updating PDF metadata in Visual Studio .NET console application


Read and view PDF metadata in ASPX webpage without any adobe viewer components


Add metadata to PDF document in C# .NET framework program


Remove and delete metadata from PDF file


Also a PDF metadata extraction control


Batch processing PDF metadata in C#.NET class


PDF document processor SDK from RasterEdge is a professional PDF component package that covers all the aspects of PDF document manipulations in .NET Framework application, like creating, viewing, saving, editing, annotating and handling.


The term metadata can be literally interpreted as "data about data". In PDF document imaging applications, metadata can be used as a useful method to provide additional information about the PDF document, such as the information about PDF document author, PDF publication date and copyright restrictions.


RasterEdge XDoc.PDF SDK for .NET supplies optimized standards-based PDF document metadata processing technologies. C#.NET developers can easily integrate this PDF document metadata manipulating control into their professional PDF document content management system, which can not only allow developers and end-users to edit PDF document metadata but also permit them to have an extensive search for encoded metadata based on certain parameters.






C# read PDF document metadata information


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.




        #region read PDF document metadata information
        internal static void readPdfMetadata()
        {
            // Retrieve PDF document metadata.
            String inputFilePath = @"C:\demo.pdf";
            PDFDocument doc = new PDFDocument(inputFilePath);
            PDFMetadata metadata = doc.GetDescription();
            Console.WriteLine("Title:         " + metadata.Title);
            Console.WriteLine("Author:        " + metadata.Author);
            Console.WriteLine("Subject:       " + metadata.Subject);
            Console.WriteLine("Keywords:      " + metadata.Keywords);
            Console.WriteLine("Creator:       " + metadata.Creator);
            Console.WriteLine("Producer:      " + metadata.Producer);
            Console.WriteLine("Create Date:   " + metadata.CreatedDate.ToString());
            Console.WriteLine("Modified Date: " + metadata.ModifiedDate.ToString());
        }
        #endregion




C# update PDF document metadata information





        #region update PDF document metadata information
        internal static void updatePdfMetadata()
        {
            // Update PDF document metadata.
            PDFMetadata metadata = new PDFMetadata();
            metadata.Title = "Title";
            metadata.Author = "Qi";
            metadata.Subject = "None";
            metadata.Keywords = "University, Public, etc.";
            metadata.Creator = "MS Office Word";
            metadata.Producer = "RE";
            metadata.CreatedDate = new DateTime(2014, 11, 21, 10, 45, 12);
            metadata.ModifiedDate = new DateTime(2015, 11, 21, 10, 45, 12);

            String inputFilePath = @"C:\demo.pdf";
            String outputFilePath = @"C:\output.pdf";
            PDFDocument doc = new PDFDocument(inputFilePath);

            doc.SetDescription(metadata);
            doc.Save(outputFilePath);
        }
        #endregion




C# delete PDF document metadata information





        #region delete PDF document metadata information
        internal static void deletePdfMetadata()
        {
            // Set PDF document metadata with default value.
            PDFMetadata metadata = new PDFMetadata();
            metadata.Title = "";
            metadata.Author = "";
            metadata.Subject = "";
            metadata.Keywords = "";
            metadata.Creator = "";
            metadata.Producer = "";
            metadata.CreatedDate = new DateTime(2014, 11, 21, 10, 45, 12);
            metadata.ModifiedDate = new DateTime(2015, 11, 21, 10, 45, 12);

            String inputFilePath = @"C:\demo.pdf";
            String outputFilePath = @"C:\output.pdf";
            PDFDocument doc = new PDFDocument(inputFilePath);

            doc.SetDescription(metadata);
            doc.Save(outputFilePath);
        }
        #endregion




.NET Class Namespace Required



In order to run the sample code, the following steps would be necessary.


Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;