public static void Main() { // The path to the documents directory. string dataDir = Path.GetFullPath("../../../Data/"); //create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); //bind pdf file to the object xmpMetaData.BindPdf(dataDir+ "input.pdf"); //get XMP Meta Data properties Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreateDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.MetadataDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreatorTool].ToString()); Console.WriteLine(": {0}", xmpMetaData["customNamespace:UserPropertyName"].ToString()); Console.ReadLine(); }
public static void Main() { // The path to the documents directory. string dataDir = Path.GetFullPath("../../../Data/"); //create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); //bind pdf file to the object xmpMetaData.BindPdf(dataDir + "input.pdf"); //get XMP Meta Data properties Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreateDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.MetadataDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreatorTool].ToString()); Console.WriteLine(": {0}", xmpMetaData["customNamespace:UserPropertyName"].ToString()); Console.ReadLine(); }
public static void Run() { // ExStart:GetXMPMetadata // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_WorkingDocuments(); // Create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); // Bind pdf file to the object xmpMetaData.BindPdf(dataDir + "input.pdf"); // Get XMP Meta Data properties Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreateDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.MetadataDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreatorTool].ToString()); Console.WriteLine(": {0}", xmpMetaData["customNamespace:UserPropertyName"].ToString()); Console.ReadLine(); // ExEnd:GetXMPMetadata }
public static void Run() { // ExStart:GetXMPMetadata // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_WorkingDocuments(); // Create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); // Bind pdf file to the object xmpMetaData.BindPdf( dataDir + "input.pdf"); // Get XMP Meta Data properties Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreateDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.MetadataDate].ToString()); Console.WriteLine(": {0}", xmpMetaData[DefaultMetadataProperties.CreatorTool].ToString()); Console.WriteLine(": {0}", xmpMetaData["customNamespace:UserPropertyName"].ToString()); Console.ReadLine(); // ExEnd:GetXMPMetadata }
public static void Run() { // ExStart:SetXMPMetadata // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_WorkingDocuments(); // Create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); // Bind pdf file to the object xmpMetaData.BindPdf(dataDir+ "SetXMPMetadata.pdf"); // Add create date xmpMetaData.Add(DefaultMetadataProperties.CreateDate, System.DateTime.Now.ToString()); // Change meta data date xmpMetaData[DefaultMetadataProperties.MetadataDate] = System.DateTime.Now.ToString(); // Add creator tool xmpMetaData.Add(DefaultMetadataProperties.CreatorTool, "Creator tool name"); // Remove modify date xmpMetaData.Remove(DefaultMetadataProperties.ModifyDate); // Add user defined property // Step #1: register namespace prefix and URI xmpMetaData.RegisterNamespaceURI("customNamespace", "http:// Www.customNameSpaces.com/ns/"); // Step #2: add user property with the prefix xmpMetaData.Add("customNamespace:UserPropertyName", "UserPropertyValue"); // Change user defined property xmpMetaData["customNamespace:UserPropertyName"] = "UserPropertyValue2"; // Save xmp meta data in the pdf file xmpMetaData.Save(dataDir+ "SetXMPMetadata_out.pdf"); // Close the object xmpMetaData.Close(); // ExEnd:SetXMPMetadata }
public static void Run() { // ExStart:SetXMPMetadata // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_WorkingDocuments(); // Create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); // Bind pdf file to the object xmpMetaData.BindPdf(dataDir + "SetXMPMetadata.pdf"); // Add create date xmpMetaData.Add(DefaultMetadataProperties.CreateDate, System.DateTime.Now.ToString()); // Change meta data date xmpMetaData[DefaultMetadataProperties.MetadataDate] = System.DateTime.Now.ToString(); // Add creator tool xmpMetaData.Add(DefaultMetadataProperties.CreatorTool, "Creator tool name"); // Remove modify date xmpMetaData.Remove(DefaultMetadataProperties.ModifyDate); // Add user defined property // Step #1: register namespace prefix and URI xmpMetaData.RegisterNamespaceURI("customNamespace", "http:// Www.customNameSpaces.com/ns/"); // Step #2: add user property with the prefix xmpMetaData.Add("customNamespace:UserPropertyName", "UserPropertyValue"); // Change user defined property xmpMetaData["customNamespace:UserPropertyName"] = "UserPropertyValue2"; // Save xmp meta data in the pdf file xmpMetaData.Save(dataDir + "SetXMPMetadata_out.pdf"); // Close the object xmpMetaData.Close(); // ExEnd:SetXMPMetadata }
public static void Main() { // The path to the documents directory. string dataDir = Path.GetFullPath("../../../Data/"); //create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); //bind pdf file to the object xmpMetaData.BindPdf(dataDir+ "input.pdf"); //add create date xmpMetaData.Add(DefaultMetadataProperties.CreateDate, System.DateTime.Now.ToString()); //change meta data date xmpMetaData[DefaultMetadataProperties.MetadataDate] = System.DateTime.Now.ToString(); //add creator tool xmpMetaData.Add(DefaultMetadataProperties.CreatorTool, "Creator tool name"); //remove modify date xmpMetaData.Remove(DefaultMetadataProperties.ModifyDate); //add user defined property //step #1: register namespace prefix and URI xmpMetaData.RegisterNamespaceURI("customNamespace", "http://www.customNameSpaces.com/ns/"); //step #2: add user property with the prefix xmpMetaData.Add("customNamespace:UserPropertyName", "UserPropertyValue"); //change user defined property xmpMetaData["customNamespace:UserPropertyName"] = "UserPropertyValue2"; //save xmp meta data in the pdf file xmpMetaData.Save(dataDir+ "output.pdf"); //close the object xmpMetaData.Close(); }
public static void Main() { // The path to the documents directory. string dataDir = Path.GetFullPath("../../../Data/"); //create PdfXmpMetadata object PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); //bind pdf file to the object xmpMetaData.BindPdf(dataDir + "input.pdf"); //add create date xmpMetaData.Add(DefaultMetadataProperties.CreateDate, System.DateTime.Now.ToString()); //change meta data date xmpMetaData[DefaultMetadataProperties.MetadataDate] = System.DateTime.Now.ToString(); //add creator tool xmpMetaData.Add(DefaultMetadataProperties.CreatorTool, "Creator tool name"); //remove modify date xmpMetaData.Remove(DefaultMetadataProperties.ModifyDate); //add user defined property //step #1: register namespace prefix and URI xmpMetaData.RegisterNamespaceURI("customNamespace", "http://www.customNameSpaces.com/ns/"); //step #2: add user property with the prefix xmpMetaData.Add("customNamespace:UserPropertyName", "UserPropertyValue"); //change user defined property xmpMetaData["customNamespace:UserPropertyName"] = "UserPropertyValue2"; //save xmp meta data in the pdf file xmpMetaData.Save(dataDir + "output.pdf"); //close the object xmpMetaData.Close(); }