In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the "Java to achieve PDF cutting, interception, merge tools, turn pictures" related knowledge, in the actual case of the operation process, many people will encounter such a dilemma, and then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!
Dependent Import com.itextpdf itextpdf 5.5.13 org.apache.pdfbox pdfbox 2.0.15 org.apache.pdfbox fontbox 2.0.15 tool Code import com.itextpdf.text.Document Import com.itextpdf.text.pdf.PdfCopy;import com.itextpdf.text.pdf.PdfImportedPage;import com.itextpdf.text.pdf.PdfReader;import java.io.FileOutputStream;import java.io.IOException;import java.util.ArrayList / * * @ author zh * @ data 16:20 on 2019-10-28 * Note: TODO * / public class TestPDF {public static void main (String [] args) throws IOException {} / * pdf copy to the new file * @ param pdfFile * @ param newFile * @ param from from page * @ param end to page * / public static void copyPdfFile (String pdfFile, String newFile, int from, int end) {Document document = null PdfCopy copy = null; try {PdfReader reader = new PdfReader (pdfFile); int n = reader.getNumberOfPages (); if (end = = 0) {end = n;} ArrayList savepaths = new ArrayList (); String staticpath = pdfFile.substring (0, pdfFile.lastIndexOf ("\") + 1) String savepath = staticpath + newFile; savepaths.add (savepath); document = new Document (reader.getPageSize (1)); copy = new PdfCopy (document, new FileOutputStream (savepaths.get (0)); document.open (); for (int j = from; j)
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.