All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.formkiq.vision.document.DocumentSource Maven / Gradle / Ivy

/*
 * Copyright (C) 2018 FormKiQ Inc.
 *
 * Licensed 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.
 */
package com.formkiq.vision.document;

import java.io.IOException;
import java.util.List;

/**
 * Source Document for {@link DocumentSource}.
 *
 */
public interface DocumentSource {

    /**
     * Close Source.
     * @throws IOException IOException
     */
    void close() throws IOException;

    /**
	 * Convert {@link DocumentField} to {@link DocumentContentField}.
	 * @param field {@link DocumentField}
	 * @return {@link DocumentContentField}
	 */
    DocumentContentField convertField(DocumentField field);

    /**
     * Document Name.
     * @return {@link String}
     */
	String getDocumentName();

	/**
     * Get {@link DocumentField} for a page.
     * @param pageNumber int
     * @return {@link List} {@link DocumentField}
     */
    List getFields(int pageNumber);

    /**
	 * Get Images.
	 * @param pageNumber {@link Integer}
	 * @return {@link List} {@link DocumentImage}
	 */
    List getImages(Integer pageNumber);

	/**
     * Get Page Count.
     * @return int
     */
    int getPageCount();

	/**
	 * Get Page Height.
	 * @param pageNumber int
	 * @return float
	 */
    float getPageHeight(int pageNumber);

	/**
	 * Get Page Width.
	 * @param pageNumber int
	 * @return float
	 */
	float getPageWidth(int pageNumber);

	/**
     * Get {@link DocumentBlockRectangle}.
     * @param pageNumber int
     * @return {@link List} {@link DocumentBlockRectangle}
     * @throws IOException IOException
     */
    List getRawBlocks(int pageNumber) throws IOException;

	/**
     * Get {@link DocumentText}.
     * @param pageNumber int
     * @return {@link List} {@link DocumentText}
     */
	List getTexts(int pageNumber);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy