[Java] Convert PDF version

In everyday life and work, the device we use is now a PDF version Is it often the case that strict conditions are required? In such a case, I think you need to convert the PDF version to fit the device. So, in this article, I will explain how to convert PDF version using Free Spire.PDF for Java (PDF version 1.0-1.7 can be converted).

** Import JAR package ** ** Method 1: ** After downloading and unzipping Free Spire.PDF for Java, in the lib folder Import the Spire.Pdf.jar package as a dependency into your Java application.

** Method 2: ** After installing the JAR package directly from the Maven repository, configure the pom.xml file as follows:

<repositories>
   <repository>
      <id>com.e-iceblue</id>
      <name>e-iceblue</name>
      <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
   </repository>
</repositories>
<dependencies>
   <dependency>
      <groupId>e-iceblue</groupId>
      <artifactId>spire.pdf.free</artifactId>
      <version>3.9.0</version>
   </dependency>
</dependencies>

** Java sample code: **

package com.spire.pdf;

public class ChangePdfVersion {

    public static void main(String[] args) {

        //Create a PdfDocument object
        PdfDocument document = new PdfDocument();

        //Import a PDF document
        document.loadFromFile("test.pdf");

        //PDF version 1.Change to 6
        document.getFileInfo().setVersion(PdfVersion.Version_1_6);

        //Save the document
        document.saveToFile("ChangePdfVersion.pdf", FileFormat.PDF);
        document.close();
    }
}

** Completion example: ** ch.png

Recommended Posts

[Java] Convert PDF version
Java version check
Java compressed PDF document
Java version notation comparison
Switching java version (memorial)
[Java] PDF viewing settings
Launch Docker from Java to convert Office documents to PDF
Java applications convert Word (DOC / DOCX) documents to PDF
Learning Java framework # 1 (Mac version)
Java version control on macOS
Java version 8 and later features
How to lower java version
Convert Java Powerpoint to XPS
Java adds table to PDF
Save Java PDF in Excel
Java encryption and decryption PDF
Version control Java with SDKMAN
Paging PDF with Java + PDFBox.jar
Java turns Excel into PDF
Save Java HTML as PDF
Java version control with jenv
Java version change on CentOS
Simplify java version switching (Mac)
How to convert Java radix
[Java] Convert ArrayList to array
Java version notation that changes in Java 10
[Java version] The story of serialization
I created a PDF in Java.
Java to extract PDF text content
[Grover] Generate PDF with Rails [2020 version]
Add, modify, delete JAVA PDF bookmarks
[Java] Convert 1-to-N List to Map
Java
Output PDF and TIFF with Java 8
Add, replace, delete Java PDF images
Add watermark to Java to PDF document
Java
[Android] Convert Android Java code to Kotlin
Java draws shapes in PDF documents
Java adds form fields to PDF
[Java] Convert array to ArrayList * Caution
Add index with Java8 Stream.map (tuple version)
Convert Java org.w3c.dom.Document objects and XML strings
Convert all Android apps (Java) to Kotlin
Convert from java UTC time to JST time
Using JavaScript from Java in Rhino 2021 version
Installation of OMC APM Agent --Java version-
Eclipse screen layout change method (Java version)
[Java] Convert Object type null to String type
Java version control with jenv on OSX
Convert SVG files to PNG files in Java
Download and install Eclipse (Java) (Mac version)
How to install the legacy version [Java]
Java version control using cask + anyenv + jenv
Program PDF headers and footers in Java
# Java: vol1: [java / JDK version control best practice]
Java installation (Mac, Homebrew, multiple version control)