Posts

Showing posts from January, 2023

Java: How to Add Document Properties to Word Documents

Image
  Word document properties include general, summary, statistics, content, custom. The summary includes items such as title, subject, author, manager, unit, category, keywords, remarks, etc. Attributes are equivalent to the business card of the document, and you can add comments, instructions, etc. you want. You can also mark the copyright. Today I will introduce to you how to add document properties to Word documents through Java code. Please read below for details. Add Built-in Document Properties to a Word Document Add Custom Document Properties to a Word Document Programming Environment First, you’re required to add the Spire.Doc.jar file as a dependency in your Java program. The JAR file can be downloaded from this link. Method 1: Introduced manually. Download Free Spire.Doc for Java locally, unzip it, and find the Spire.Doc.jar file in the lib folder. Open the following interface in IDEA, and import the jar file in the local path into the Java program: If you use M...

Java: How to Highlight Values Above or Below Average in Excel

Image
 If you want to find numbers above or below the average, you can look at higher or lower values without calculating the average. Through a Java application, these numbers can be highlighted automatically. In addition to quickly highlighting values above or below the average, you can also see how many values are above or below. Now let's see how this can be implemented in a Java application. Programming Environment Method 1: Introduced manually. Download Free Spire.XLS for Java locally, unzip it, and find the Spire.Xls.jar file in the lib folder. Open the following interface in IDEA, and import the jar file in the local path into the Java program: If you use Maven , you can easily import the JAR file in your application by adding the following code to your project’s pom.xml file. <repositories>     <repository>         <id>com.e-iceblue</id>         <name>e-ice...

How to Add or Remove Attachments in PDF via Java Code?

Image
We can add attachments to PDF files or PowerPoint presentations to make them more comprehensive and detailed. Attaching related documents to PDF can facilitate centralized management and transmission of documents. So how to add or remove attachments in PDF? Don't worry, we can easily do this programmatically. For your reference, I have attached the Java code for the specific steps I have organized.     Document Level Attachment: A file attached to a PDF at the document level won't appear on a page, but can only be viewed in the "Attachments" panel of a PDF reader.     Annotation Attachment: A file will be added to a specific position of a page. Annotation attachments are shown as a paper clip icon on the page; reviewers can double-click the icon to open the file. Add an Attachment to PDF in Java Add an Annotation Attachment to PDF in Java Remove Attachments from PDF in Java Remove Annotation Attachments from PDF in Java Programming Environment Meth...