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.*; […]

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 […]

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; […]

Spring boot+itextpdf generates a simple application of pdf

1.Introduce maveny dependencies <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> 2. Implement the code // pdf file saving path String fileName = voSubLedger.getTargetPath() + “/” + beginDate + “-” + endDate + categoryName + “detailed account” + “.pdf”; //Create a document instance, set the specification to A4 paper, and set the margins […]

[Java] Generate barcodes in batches-itextpdf

Generate barcodes in batches Controller @ApiOperation(“Product list generates product barcodes in batches”) @PostMapping(“/batchGenerateProdBarCode”) public void batchGenerateProdBarCode(@RequestBody ProductListCondition productListCondition,HttpServletResponse response){<!– –> importExportService.batchGenerateProdBarCode(response, productListCondition); } service /** * Product list generates product barcodes in batches * @param productListCondition * @return */ public void batchGenerateProdBarCode(HttpServletResponse response,ProductListCondition productListCondition){<!– –> List<MProductEx> productExList = mProductListDao.selectmproduct( productListCondition.getProdCdDis(),productListCondition.getBrand()); try {<!– –> int dataCount […]

Use itextpdf to sign and stamp pdf

package com.zhou.stamp; import com.itextpdf.text.Image; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.PdfSignatureAppearance; import com.itextpdf.text.pdf.PdfStamper; import com.itextpdf.text.pdf.security.*; import lombok.Data; import lombok. SneakyThrows; import org.springframework.beans.BeanUtils; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.security.KeyStore; import java.security.PrivateKey; import java.security.cert.Certificate; import java.util.Calendar; /** * @author lang.zhou * @since 2023/8/1 13:42 */ @Data public class PDFStamper { private String pdf; public […]

springboot integrates itextpdf plug-in to export pdf format files

1. Introduce dependencies <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> 2. Create a tool class package com.csg.ats.util; import cn.hutool.core.date.DateUtil; import com.csg.ats.entity.ReportInfo; import com.csg.ats.enums.ProductTypeEnum; import com.csg.ats.enums.ReportTypeEnum; import com.csg.ats.enums.ResultEnum; import com.csg.ats.vo.ReportVo; import com.itextpdf.text.*; import com.itextpdf.text.pdf.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; import java.net.URLEncoder; import java.util.List; public class DownloadPDFUtil { public static void downloadPdf(ReportVo reportVo, […]

# ItextPdf Layout 7.2.3 Add watermark

ItextPdf Layout 7.2.3 Add watermark Background introduction Use Itextpdf Layout 7.2.3 , need to add watermark on Pdf Itext 5 Adding watermark has already been mentioned in the previous article, you can read this article: Itext5 common API Use PdfCanvas related methods Article directory ItextPdf Layout 7.2.3 add watermark background introduction ItextPdf Layout Watermark related […]

JAVA uses itextpdf to generate pdf files

First look at the effect: rely: <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.10</version> </dependency> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itext-asian</artifactId> <version>5.2.0</version> </dependency> Reference: https://blog.csdn.net/lcczpp/article/details/125424395 Relevant code: package com.qxs.business.reform.utils.poi; import com.itextpdf.text.*; import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; import com.qxs.business.attachment.dto.PdfPageXofYEventHelper; import org.apache.commons.lang.StringUtils; import java.io.FileOutputStream; import java.util.concurrent.atomic.AtomicInteger; public class PdfUtils { private static BaseFont bfChinese; /** * plus black 22 */ private […]