Skip to main content

Posts

Java - Extract Images from PDF and Compress PDF Image Size

  In some document processing scenarios, PDF files often contain many images, such as scanned documents, product manuals, report attachments, contract images, and so on. Sometimes we need to extract images from a PDF for archiving, recognition, or further editing. In other cases, a PDF file may become too large because it contains high-resolution images, and image compression becomes necessary. This article uses demonstrate two common operations: Extract images from a PDF document in Java Compress high-quality images in a PDF document in Java 1. Preparation The sample code uses a Maven project. First, add the Spire.PDF for Java dependency to your pom.xml file. <repositories> <repository> <id> com.e-iceblue </id> <name> e-iceblue </name> <url> https://repo.e-iceblue.com/nexus/content/groups/public/ </url> </repository> </repositories> <dependencies> <dependency> ...

Print Word Document in Java

  In enterprise applications, Word document printing is usually not a core feature at first glance, but it often becomes essential once workflows move into production. Common scenarios include: Automated generation and printing of reports Batch printing of contracts, invoices, or statements Backend services generating documents without user interaction Integration with enterprise systems such as ERP or OA platforms Unlike plain text printing, Word document printing involves rendering layout, maintaining formatting consistency, and interacting with system-level printers. These details are where most implementation challenges appear in real projects. This guide walks through practical ways to print Word documents in Java, from basic usage to more controlled scenarios like page setup, duplex printing, and batch processing. Environment setup For handling Word documents, Spire.Doc is used here as the document processing layer. It takes care of loading and rendering Word files before the...