Edit PUB Metadata

Read MS Publisher file. PUB Metatada editor API for Java

 

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 Java 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 Java PUB Metadata API. The following example will show you how to edit the "Language" property.

How to Edit PUB Metadata Using Java

In order to Edit PUB Metadata, we’ll use Aspose.PUB for Java API which is a feature-rich, powerful, and easy-to-use conversion API for the Java platform. You can download its latest version directly from Aspose Maven Repository and install it within your Maven-based project by adding the following configurations to the pom.xml.

Repository

<repository>
    <id>snapshots</id>
    <name>repo</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>

Dependency

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-pub</artifactId>
    <version>20.8</version>
</dependency>

View and Edit PUB Metadata on Java

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 IPdfConverter Interface.

System Requirements

Aspose.PUB for Java is supported on all major operating systems. Just make sure that you have the following prerequisites.

J2SE 8.0 (1.8) or above.

Java Code to Update PUB Metadata

    // Load PUB file
    IPubParser parser = PubFactory.createParser(fileName);
    // Parse file 
    Document doc = parser.parse();
    // Set Language information
document.getDocumentSummaryInfo().setLanguage("language");



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