API to manipulate Publisher files in C#

Aspose.PUB for .NET lets you work with PUB files in your .NET applications. It supports manipulating .pub files with a simple and well-defined structure. 

Edit MetaData of PUB Files

Metadata of .pub files accessible by Aspose.PUB

Microsoft Publisher (.pub) files have metadata information about the file itself. There is examples of information that you can get using this API Solution:

MetadataDescription
Application NameThe name of the application that was used to create the document
TitleThe title of the publication.
AuthorThe name of the person or entity who created the publication.
VersionVersion value
SubjectA brief description or topic associated with the publication.
KeywordsRelevant keywords or tags to describe the content of the publication.
CommentsAdditional notes related to the publication.
Creation DateThe date when the publication was originally created.
Modification DateThe date when the publication was last edited.
Last AuthorThe name of the person who last made changes to the document.
TemplateApplication-specific template from which the document was created.
Character CountProvides the total number of characters in the document.
Word CountProvides the total number of words in the document.
Page CountProvides the total number of pages in the document.

Functionality to work with metadata of .pub files provided by Aspose.PUB for .NET

MetaData of a document describes a file in terms of its properties such as author, title, last author, company, language, and other similar information. This is useful information that is stored along with the document. Aspose.PUB for .NET lets you edit metadata of a PUB file using the DocSummaryInfo and SummaryInfo classes as shown in the following code sample.

 1    string dataDir = RunExamples.GetDataDir_Data();
 2
 3    string pubFile = dataDir + "document.pub";
 4
 5    IPubParser parser = PubFactory.CreateParser(pubFile);
 6    Document document = parser.Parse();
 7
 8    document.DocumentSummaryInfo.SetCategory("category");
 9    document.DocumentSummaryInfo.SetCompany("company");
10    document.DocumentSummaryInfo.SetLanguage("language");
11
12    document.SummaryInfo.SetComments("comments");
13    document.SummaryInfo.SetKeywords("keywords");
14    document.SummaryInfo.SetLastAuthor("last author");
15    document.SummaryInfo.SetTitle("title");
16    document.SummaryInfo.SetSubject("subject");

To learn all the .NET code examples and data files, please go to Aspose.PUB-Documentation for C# Github project.

Also take a look at the functionality provided by Aspose.PUB implemented into a set of cross-platform applications to manipulate .pub files.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.