What Is poi-scratchpad-5.2.3.jar?

What Is poi-scratchpad-5.2.3.jar?

✍: FYIcenter.com

poi-scratchpad-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an API for Microsoft document files of Word, Excel, PowerPoint, and Visio.

poi-scratchpad-5.2.3.jar provides support for older versions of Microsoft document files like Word 97, Excel 97, PowerPoint 97, etc.

poi-scratchpad-5.2.3.jar is distributed as part of the poi-bin-5.2.3-20220909.zip download file.

JAR File Size and Download Location:

JAR name: poi-scratchpad-5.2.3.jar
Target JDK version: 9

File name: poi-scratchpad.jar, poi-scratchpad-5.2.3.jar
File size: 1897121 bytes
Release date: 09-09-2022
Download: Apache POI Website

Here are Java Source Code files for poi-scratchpad-5.2.3.jar:


/* ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at


   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   See the License for the specific language governing permissions and
   limitations under the License.
==================================================================== */

package org.apache.poi.hemf.record.emf;

import static org.apache.poi.hemf.record.emf.HemfDraw.readDimensionInt;
import static org.apache.poi.hemf.record.emf.HemfDraw.readRectL;
import static org.apache.poi.hemf.record.emf.HemfRecordIterator.HEADER_SIZE;

import java.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Supplier;

import org.apache.poi.util.Dimension2DDouble;
import org.apache.poi.util.GenericRecordJsonWriter;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndianConsts;
import org.apache.poi.util.LittleEndianInputStream;

 * Extracts the full header from EMF files.
 * @see org.apache.poi.sl.image.ImageHeaderEMF
public class HemfHeader implements HemfRecord {

    private final Rectangle2D boundsRectangle = new Rectangle2D.Double();
    private final Rectangle2D frameRectangle = new Rectangle2D.Double();
    private long bytes;
    private long records;
    private int handles;
    private String description;
    private long nPalEntries;
    private boolean hasExtension1;
    private long cbPixelFormat;
    private long offPixelFormat;
    private long bOpenGL;
    private boolean hasExtension2;
    private final Dimension2D deviceDimension = new Dimension2DDouble();
    private final Dimension2D milliDimension = new Dimension2DDouble();
    private final Dimension2D microDimension = new Dimension2DDouble();

    public Rectangle2D getBoundsRectangle() {
        return boundsRectangle;

    public Rectangle2D getFrameRectangle() {
        return frameRectangle;

    public long getBytes() {
        return bytes;

    public long getRecords() {
        return records;

    public int getHandles() {
        return handles;

    public String getDescription() { return description; }

    public long getNPalEntries() {
        return nPalEntries;

    public boolean isHasExtension1() {
        return hasExtension1;

    public long getCbPixelFormat() {
        return cbPixelFormat;

    public long getOffPixelFormat() {
        return offPixelFormat;

    public long getbOpenGL() {
        return bOpenGL;

    public boolean isHasExtension2() {
        return hasExtension2;

    public Dimension2D getDeviceDimension() {
        return deviceDimension;

    public Dimension2D getMilliDimension() {
        return milliDimension;

    public Dimension2D getMicroDimension() {
        return microDimension;

    public String toString() {
        return GenericRecordJsonWriter.marshal(this);

    public HemfRecordType getEmfRecordType() {
        return HemfRecordType.header;

    public long init(LittleEndianInputStream leis, long recordSize, long recordId) throws IOException {
        if (recordId != HemfRecordType.header.id) {
            throw new IOException("Not a valid EMF header. Record type:"+recordId);

        int startIdx = leis.getReadIndex();

        long size = readRectL(leis, boundsRectangle);
        size += readRectL(leis, frameRectangle);

        int recordSignature = leis.readInt();
        if (recordSignature != 0x464D4520) {
            throw new IOException("bad record signature: " + recordSignature);

        long version = leis.readInt();
        //According to the spec, MSOffice doesn't pay attention to this value.
        //It _should_ be 0x00010000
        bytes = leis.readUInt();
        records = leis.readUInt();
        handles = leis.readUShort();

        int nDescription = (int)leis.readUInt();
        int offDescription = (int)leis.readUInt();
        nPalEntries = leis.readUInt();

        size += 8*LittleEndianConsts.INT_SIZE;

        size += readDimensionInt(leis, deviceDimension);
        size += readDimensionInt(leis, milliDimension);

        if (nDescription > 0 && offDescription > 0) {
            int skip = (int)(offDescription - (size + HEADER_SIZE));
            byte[] buf = new byte[(nDescription-1)*2];
            description = new String(buf, StandardCharsets.UTF_16LE).replace((char)0, ' ').trim();

        if (size+12 <= recordSize) {
            hasExtension1 = true;
            cbPixelFormat =  leis.readUInt();
            offPixelFormat = leis.readUInt();
            bOpenGL = leis.readUInt();
            size += 3*LittleEndianConsts.INT_SIZE;

        if (size+8 <= recordSize) {
            hasExtension2 = true;
            size += readDimensionInt(leis, microDimension);

        return size;

    public Map<String, Supplier<?>> getGenericProperties() {
        final Map<String,Supplier<?>> m = new LinkedHashMap<>();
        m.put("boundsRectangle", this::getBoundsRectangle);
        m.put("frameRectangle", this::getFrameRectangle);
        m.put("bytes", this::getBytes);
        m.put("records", this::getRecords);
        m.put("handles", this::getHandles);
        m.put("description", this::getDescription);
        m.put("nPalEntries", this::getNPalEntries);
        m.put("hasExtension1", this::isHasExtension1);
        m.put("cbPixelFormat", this::getCbPixelFormat);
        m.put("offPixelFormat", this::getOffPixelFormat);
        m.put("bOpenGL", this::getbOpenGL);
        m.put("hasExtension2", this::isHasExtension2);
        m.put("deviceDimension", this::getDeviceDimension);
        m.put("milliDimension", this::getMilliDimension);
        m.put("microDimension", this::getMicroDimension);
        return Collections.unmodifiableMap(m);


Or download all of them as a single archive file:

File name: poi-scratchpad-5.2.3-src.zip
File size: 1238744 bytes
Release date: 2022-09-09


What Is poi-examples-5.2.3.jar?

What Is poi-excelant-5.2.3.jar?

Downloading and Installing Apache POI Java Library

⇑⇑ FAQ for Apache POI (Poor Obfuscation Implementation)

2017-03-22, 6021👍, 0💬