What Is fop.jar in fop-2.7-bin.zip

What Is fop.jar? I got it from the fop-2.7-bin.zip.

✍: FYIcenter.com

fop.jar in fop-2.7-bin.zip is the JAR file for FOP 2.7, which is a print formatter driven by XSL formatting objects (XSL-FO). You can obtain fop.jar from the build folder of the fop-2.7-bin.zip file.

Below is the information about the fop.jar (2.2) file:

JAR File Size and Download Location:

JAR name: fop.jar, fop-2.7.jar
Target JDK version: 1.7
File name: fop.jar
File size: 4442817 bytes
Release date: 20-Jan-2022
Download: Apache FOP Website

Java source code files for fop.jar:

org/apache/fop/pdf/PDFPage.java

/*
 * 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
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* $Id: PDFPage.java 1760942 2016-09-15 14:37:18Z ssteiner $ */

package org.apache.fop.pdf;

import java.awt.geom.Rectangle2D;

/**
 * Class representing a /Page object.
 * <p>
 * There is one of these for every page in a PDF document. The object
 * specifies the dimensions of the page and references a /Resources
 * object, a contents stream and the page's parent in the page
 * hierarchy.
 */
public class PDFPage extends PDFResourceContext {

    /** the page index (zero-based) */
    protected int pageIndex;

    /**
     * Create a /Page object
     *
     * @param resources the /Resources object
     * @param pageIndex the page's zero-based index (or -1 if the page number is auto-determined)
     * @param mediaBox the MediaBox
     * @param cropBox the CropBox. If null, mediaBox is used.
     * @param bleedBox the BleedBox. If null, cropBox is used.
     * @param trimBox the TrimBox. If null, bleedBox is used.
     */
    public PDFPage(PDFResources resources, int pageIndex,
                   Rectangle2D mediaBox, Rectangle2D cropBox,
                   Rectangle2D bleedBox, Rectangle2D trimBox) {
      /* generic creation of object */
      super(resources);

      put("Type", new PDFName("Page"));
      /* set fields using parameters */
      setSimplePageSize(mediaBox, cropBox, bleedBox, trimBox);
      this.pageIndex = pageIndex;
    }

    private void setSimplePageSize(Rectangle2D mediaBox, Rectangle2D cropBox,
                                   Rectangle2D bleedBox, Rectangle2D trimBox) {
        setMediaBox(mediaBox);

        if (cropBox == null) {
            cropBox = mediaBox;
        }
        setCropBox(cropBox);

        if (bleedBox == null) {
            bleedBox = cropBox;
        }
        setBleedBox(bleedBox); //Recommended by PDF/X

        if (trimBox == null) {
            trimBox = bleedBox;
        }
        setTrimBox(trimBox); //Needed for PDF/X
    }

    private PDFArray toPDFArray(Rectangle2D box) {
        return new PDFArray(this, new double[] {
                box.getX(), box.getY(), box.getMaxX(), box.getMaxY()});
    }

    /**
     * Sets the "MediaBox" entry
     * @param box the media rectangle
     */
    public void setMediaBox(Rectangle2D box) {
        put("MediaBox", toPDFArray(box));
    }

    /**
     * Sets the "CropBox" entry
     * @param box the bleed rectangle
     */
    public void setCropBox(Rectangle2D box) {
        put("CropBox", toPDFArray(box));
    }

    /**
     * Sets the "BleedBox" entry
     * @param box the bleed rectangle
     */
    public void setBleedBox(Rectangle2D box) {
        put("BleedBox", toPDFArray(box));
    }

    /**
     * Sets the "TrimBox" entry
     * @param box the trim rectangle
     */
    public void setTrimBox(Rectangle2D box) {
        put("TrimBox", toPDFArray(box));
    }

    /**
     * set this page contents
     *
     * @param contents the contents of the page
     */
    public void setContents(PDFReference contents) {
        if (contents != null) {
            put("Contents", contents);
        }
    }

    /**
     * set this page's parent
     *
     * @param parent the /Pages object that is this page's parent
     */
    public void setParent(PDFPages parent) {
        put("Parent", new PDFReference(parent));
    }

    /**
     * Set the transition dictionary and duration.
     * This sets the duration of the page and the transition
     * dictionary used when going to the next page.
     *
     * @param dur the duration in seconds
     * @param tr the transition dictionary
     */
    public void setTransition(int dur, TransitionDictionary tr) {
        put("Dur", Integer.valueOf(dur));
        put("Trans", tr);
    }

    /**
     * @return the page Index of this page (zero-based), -1 if it the page index should
     *         automatically be determined.
     */
    public int getPageIndex() {
        return this.pageIndex;
    }

    /**
     * Sets the "StructParents" value.
     * @param structParents the integer key of this object's entry in the structural parent tree.
     */
    public void setStructParents(int structParents) {
        put("StructParents", structParents);
        //This is a PDF 1.5 feature. It is set as a work-around for a bug in Adobe Acrobat
        //which reports this missing even if the PDF file is PDF 1.4.
        setTabs(new PDFName("S"));
    }

    /**
     * Returns the value of the StructParents entry.
     *
     * @return the StructParents value, <code>null</code> if the entry has not been set
     */
    public Integer getStructParents() {
        return (Integer) get("StructParents");
    }

    /**
     * Specifies the tab order for annotations on a page.
     * @param value one of the allowed values (see PDF 1.5)
     * @since PDF 1.5
     */
    public void setTabs(PDFName value) {
        put("Tabs", value);
    }

}

org/apache/fop/pdf/PDFPage.java

 

Or download all of them as a single archive file:

File name: fop-2.7-src.zip
File size: 3401312 bytes
Release date: 2022-01-20
Download 

 

"fop" Command in fop-2.7-bin.zip

What Is fop-2.7-bin.zip

Download and Installing of FOP 2.x

⇑⇑ FAQ for FOP (Formatting Object Processor)

2016-07-07, 36670👍, 0💬