In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to achieve Java PDF into PDF/A, I believe that most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Jar package Import
Spire.Pdf.jar is imported into this program. You can configure pom.xml in the Maven program as follows to download and import:
Com.e-iceblue e-iceblue https://repo.e-iceblue.cn/repository/maven-public/ e-iceblue spire.pdf 5.1.0
Alternatively, you can download Jar locally, extract it, and locate the jar file in the lib folder, and then manually import it in the Java program by doing the following:
Convert PDF to PDF/A
The PdfStandardsConverter class in Spire.PDF for Java enumerates several ways to convert PDF to local PDF/A files and stream files, as shown in the following table:
Method interpretation PdfStandardsConverter.toPdfA1A (String filePath) save as PDF/A1A to specified path PdfStandardsConverter.toPdfA1A (OutputStream stream) save as PDF/A1A to stream PdfStandardsConverter.toPdfA1B (String filePath) save as PDF/A1B to specified path PdfStandardsConverter.toPdfA1B (OutputStream stream) save as PDF/A1B to stream PdfStandardsConverter.toPdfA2A (String filePath) save as PDF/A2A to specified path PdfStandardsConverter.toPdfA2A (OutputStream stream) save as PDF/A2A to stream PdfStandardsConverter.toPdfA2B (String filePath) save as PDF/A2B to specified path Path PdfStandardsConverter.toPdfA2B (OutputStream stream) save as PDF/A2B to stream PdfStandardsConverter.toPdfA3A (String filePath) save as PDF/A3A to specified path PdfStandardsConverter.toPdfA3A (OutputStream stream) save as PDF/A3A to stream PdfStandardsConverter.toPdfA3B (String filePath) save as PDF/A3B to specified path PdfStandardsConverter.toPdfA3B (OutputStream stream) save as PDF/A3B to stream
When realizing the format conversion, it only takes two lines of code to complete the conversion and get the target PDF/A format. The following are code example steps to implement the transformation:
Instantiate the object of the PdfStandardsConverter class and load the PDF source document.
Convert PDF to PDF/An in the specified standard format by calling the specified method in the table above, and save it.
Java
Import com.spire.pdf.conversion.PdfStandardsConverter;public class PDFtoPDFA {public static void main (String [] args) {/ / create an object of PdfStandardsConverter class, pass in the document path PdfStandardsConverter converter = new PdfStandardsConverter ("sample.pdf"); / / convert to PdfA1A converter.toPdfA1A ("ToPdfA1A.pdf"); / / convert to PdfA1B converter.toPdfA1B ("ToPdfA1B.pdf") / convert to PdfA2A converter.toPdfA2A ("ToPdfA2A.pdf"); / convert to PdfA2B converter.toPdfA2B ("ToPdfA2B.pdf"); / / convert to PdfA3A converter.toPdfA3A ("ToPdfA3A.pdf"); / / convert to PdfA3B converter.toPdfA3B ("ToPdfA3B.pdf");}}
PDF/A format conversion effect, as shown in the figure:
The above is all the content of the article "how to convert PDF into PDF/A by Java". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.