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.hslf.blip;

import java.awt.Dimension;
import java.awt.Rectangle;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.DeflaterOutputStream;

import org.apache.commons.io.input.UnsynchronizedByteArrayInputStream;
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
import org.apache.poi.ddf.EscherBSERecord;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.hslf.usermodel.HSLFPictureData;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianInputStream;
import org.apache.poi.util.LittleEndianOutputStream;
import org.apache.poi.util.Units;

 * Represents a metafile picture which can be one of the following types: EMF, WMF, or PICT.
 * A metafile is stored compressed using the ZIP deflate/inflate algorithm.
public abstract class Metafile extends HSLFPictureData {

     * Creates a new instance.
     * @param recordContainer Record tracking all pictures. Should be attached to the slideshow that this picture is
     *                        linked to.
     * @param bse Record referencing this picture. Should be attached to the slideshow that this picture is linked to.
    protected Metafile(EscherContainerRecord recordContainer, EscherBSERecord bse) {
        super(recordContainer, bse);

     *  A structure which represents a 34-byte header preceding the compressed metafile data
    public static class Header{
        private static final int RECORD_LENGTH = 34;

         * size of the original file
        private int wmfsize;

         * Boundary of the metafile drawing commands
        private final Rectangle bounds = new Rectangle();

         *  Size of the metafile in EMUs
        private final Dimension size = new Dimension();

         * size of the compressed metafile data
        private int zipsize;

         * Reserved. Always 0.
        private int compression;

         * Reserved. Always 254.
        private int filter = 254;

        public void read(byte[] data, int offset) {
            try (
                    LittleEndianInputStream leis = new LittleEndianInputStream(
                            new UnsynchronizedByteArrayInputStream(data, offset, RECORD_LENGTH))
            ) {
                wmfsize = leis.readInt();

                int left = leis.readInt();
                int top = leis.readInt();
                int right = leis.readInt();
                int bottom = leis.readInt();
                bounds.setBounds(left, top, right - left, bottom - top);

                int width = leis.readInt();
                int height = leis.readInt();
                size.setSize(width, height);

                zipsize = leis.readInt();
                compression = leis.readUByte();
                filter = leis.readUByte();
            } catch (IOException e) {
                throw new IllegalStateException(e);

        public void write(OutputStream out) throws IOException {
            LittleEndianOutputStream leos = new LittleEndianOutputStream(out);

            leos.writeInt(bounds.x + bounds.width);
            leos.writeInt(bounds.y + bounds.height);

        void write(byte[] destination, int offset) {
            LittleEndian.putInt(destination, offset, wmfsize);
            offset += 4;

            LittleEndian.putInt(destination, offset, bounds.x);
            offset += 4;

            LittleEndian.putInt(destination, offset, bounds.y);
            offset += 4;

            LittleEndian.putInt(destination, offset, bounds.x + bounds.width);
            offset += 4;

            LittleEndian.putInt(destination, offset, bounds.y + bounds.height);
            offset += 4;

            LittleEndian.putInt(destination, offset, size.width);
            offset += 4;

            LittleEndian.putInt(destination, offset, size.height);
            offset += 4;

            LittleEndian.putInt(destination, offset, zipsize);
            offset += 4;

            destination[offset] = (byte) compression;

            destination[offset] = (byte) filter;

        public int getSize(){
            return 34;

        public int getWmfSize() {
            return wmfsize;

        protected void setWmfSize(int wmfSize) {
            this.wmfsize = wmfSize;

        protected void setZipSize(int zipSize) {
            this.zipsize = zipSize;

        public Rectangle getBounds() {
            return (Rectangle)bounds.clone();

        protected void setBounds(Rectangle bounds) {

        protected void setDimension(Dimension size) {

    protected static byte[] compress(byte[] bytes, int offset, int length) {
        UnsynchronizedByteArrayOutputStream out = new UnsynchronizedByteArrayOutputStream();
        try (DeflaterOutputStream deflater = new DeflaterOutputStream(out)) {
            deflater.write(bytes, offset, length);
        } catch (IOException ignored) {
            // IOException won't get thrown by the DeflaterOutputStream in this configuration because:
            //  1. UnsynchronizedByteArrayOutputStream doesn't throw an IOException during writes.
            //  2. The DeflaterOutputStream is not finished until we're done writing.
            throw new AssertionError("Won't happen", ignored);
        return out.toByteArray();

    public Dimension getImageDimension() {
        int prefixLen = 16*getUIDInstanceCount();
        Header header = new Header();
        header.read(getRawData(), prefixLen);
        return new Dimension(


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, 6113👍, 0💬