Skip to main content

Posts

How to Extract Images and Image Information from PDF in Java

  PDF files are widely used for storing reports, manuals, e-books, and other documents that combine text and visual content. Besides text, PDF documents often contain various image resources, including charts, diagrams, screenshots, scanned pages, and illustrations. When processing PDF files programmatically, extracting images is often only part of the requirement. In many cases, developers also need additional information about those images, such as: Which page contains the image How many images exist on each page The width and height of extracted images The relationship between extracted images and the original document This information is useful in scenarios such as document archiving, content analysis, and image resource management. This article explains how to extract images from PDF files and retrieve image-related information using Java. Preparing the Environment Create a Java project and add the PDF processing dependency through Maven. Add the following configuration to pom...

How to Add Data Validation to Excel in Java (Step-by-Step)

Excel data validation is useful when a worksheet is meant to be filled in by other people. Instead of accepting any value, a cell can be limited to a number range, a date period, a certain text length, or a predefined list of choices. This is especially helpful for forms and reusable templates, where inconsistent input can create extra cleanup work later. In this tutorial, we’ll add several common validation rules to an Excel worksheet with Java, including whole number, date, text length, list, and time validation. Common Excel Data Validation Types Excel supports several validation types for different kinds of input: Validation Type Typical Use Whole number Quantities, counts, IDs Decimal Prices, percentages, measurements List Status, department, category Date Deadlines, submission dates, schedules Time Appointments, shifts, working hours Text length Codes, abbreviations, identifiers Most rules are built from three parts: the allowed data type, a comparison operator, and one or two li...