Edit PUB Metadata

Read MS Publisher file. PUB Metatada editor API for C++

 

Microsoft® Publisher document file format is used for creating various publication types such as newsletters, brochures, flyers, and postcards and is used in Emails and Websites. Pub files contain text as well as bitmap and vector graphics data.

Publisher Metadata is properties(information) that describe PUB documents. They are standard properties like publisher, title, last author, organization, URL, language, and other similar information. There is also data that is generated automatically after working with a file like its size or the last editing time. This useful information is stored along with the document.

Along with Conversion and Reading functionality, this PUB API solution for C++ lets you edit standard metadata by means of the DocSummaryInfo and SummaryInfo classes as shown in the following code sample. You may also use the API to create your own Metadata Editor application.

Before coding Metadata, you need to integrate C++ PUB Metadata API. The following example will show you how to edit the "Category" property.

View & Edit PUB Metadata on C++

The publisher Metadata reading process consists of the next steps:

  1. Upload your PUB file using CreateParser() Method of PubFactory Class.
  2. Parse file via Parse() Method of IPubParser Interface.

Get Started with CPP PUB API

  1. Install from command line as nuget install Aspose.PUB.cpp or via Package Manager Console of Visual Studio with Install-Package Aspose.PUB.cpp.
  2. Alternatively, get the offline MSI installer or DLLs in a ZIP file from downloads .

C++ Code to Modify PUB Metadata

    using namespace Aspose::PUB;
    // Load PUB file
    System::SharedPtr<IPubParser> parser = PubFactory::CreateParser("input.pub");
    // Parse file 
    System::SharedPtr<Document> document = parser->Parse();
    // Edit Category metadata
    document->get_DocumentSummaryInfo()->SetCategory(u"category");



FAQ

1. What is .pub file Metadata?

Metadata is the information like Title, Author, Keywords, Comments, Template, Rev Number, App Name, Page Count, Word Count, Char Count, Doc Security, Category, Company, and Language.

2. Is there a way to see .pub files Metadata online?

There is a cross-platform Metadata Editor in the Aspose applications ecosystem. It is free and easy to use.

3. How do I edit .PUB files metadata?

To edit the Metadata of the Publisher file you need to first upload it using CreateParser() Method and parse the document via IPubParser Interface. Edit the Metadata using the DocSummaryInfo Class.

4. Is the functionality free?

The cross-platform app is free, when for the API solution you can get a free Trial and then buy the product if needed.

  

Support and Learning Resources