itextpdf reads the specified area and writes the specified area of the new file

<dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.13</version> </dependency> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itext-asian</artifactId> <version>5.2.0</version> </dependency> Reference: Step by step IText.Sharp Chunk Phrase Paragraph List usage – cdboy – Blog Park (cnblogs.com) 1. Read the specified area of the template 2. Output the template content according to paragraphs 3. Output the specified content in the specified area package com.example.demo.pdf; import com.itextpdf.text.*; […]

EdiText limits input character types [regular rules]

Android implements limiting input character types in EditText: For example: only numbers, letters, and Chinese characters are allowed to be entered. Go directly to the code: 1. Set up monitoring: editText.addTextChangedListener(mTextWatch); 2. Process check characters during monitoring: private TextWatcher mTextWatch = new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) […]

Java Excel to PDF, supports xlsx and xls formats, itextpdf [ready to use]

Java Excel to PDF itextpdf, ready to use Tool method 1. How to use 1. Local conversion 2. Internet download 2. Introduction of pom dependencies 3. Tool methods 3. Citations This article mainly organizes the tools and methods. It is organized by referring to other bloggers’ articles for easy use. Tool methods 1. How to […]

[itext7] Use itext7 to merge multiple PDF files and pictures into one PDF file, rotate and zoom the pictures

This article mainly introduces the use of itext7 to merge multiple PDF files and pictures into one PDF file, image rotation and image scaling. Table of Contents 1. itext7 merge PDF 1.1. Introducing dependencies 1.2. Introduction to merging PDFs 1.3. Read PDF files using byte array method 1.4. Merge multiple PDF files 1.5. Merge images […]

Create PDF files using iText library

Foreword Translation link: http://howtodoinjava.com/apache-commons/create-pdf-files-in-java-itext-tutorial/ I believe everyone is familiar with reading and writing excel files. You can just use apache’s POI library. In this article, I will write various code examples based on the iText library to create PDF files. These examples will be classified according to their respective functions. In order to allow everyone […]

Java uses itextPDF to generate PDF files, save them locally and upload them to the ftp server

Title java uses itextPDF to generate PDF files, save them locally and upload them to the ftp server Required jars:itext-asian-5.2.0.jar,itextpdf-5.5.5.jar,commons-net-3.3.jar This is the only way to do it because it cannot be uploaded. Set attributes on the page, such as headers and footers package com.ibm.business.util; import java.io.IOException; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Element; import com.itextpdf.text.Font; […]

iText in action–using iText basic building blocks

2.2 Add Chunk, Phrase, Paragraph and List objects Chunk: a string, a font, some attributes Space between two lines: Leading setInitialLeading(16); setTextRise()–Set the rising height import java.io.FileOutputStream; import java.io.IOException; import java.sql.SQLException; import com.itextpdf.text.BaseColor; import com.itextpdf.text.Chunk; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Font; import com.itextpdf.text.Font.FontFamily; import com.itextpdf.text.pdf.PdfWriter; /** * Writes a list of countries to a PDF […]

iText practice–Table, cell and page event

5.1 Decorating tables using table and cell events Implement PdfPTableEvent interface Implement PdfPCellEvent interface Merge table and cell events 5.2 Events of basic building blocks Common block (Chunk) function Paragraph event Chapter and Section events Page order and blank pages 5.3 Overview of page boundaries Media Box Crop Box Other page boundaries 5.4 Add page […]

iText practice–add content based on absolute position

3.1 Introduction to the concept of direct content 4 levels of pdf content Level 1: Under text and graphics, PdfWriter.getDirectContentUnder() Level 2: graphics layer, Chunk, Images background, PdfPCell boundary, etc. Level 3: text layer, Chunks, Phrases, Paragraphs content, etc. Level 4: On top of text and graphics, PdfWriter.getDirectContent() import java.io.FileOutputStream; import java.io.IOException; import com.itextpdf.text.Document; import […]

iText in action–working on existing PDFs

6.1 Use PdfReader to read PDF Retrieve document and page information D:/data/iText/inAction/chapter03/image_direct.pdf Number of pages: 1 Size of page 1: [0.0,0.0,283.0,416.0] Rotation of page 1: 0 Page size with rotation of page 1: Rectangle: 283.0×416.0 (rot: 0 degrees) Is rebuilt? false Is encrypted? false import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Rectangle; import […]