Package org.axsl.ps

Examples of org.axsl.ps.PsEncodeFilter


        } else if (filterType.equals("ascii-hex")) {
            psFilterType = PsFilterType.ASCII_HEX;
        } else {
            throw new PdfException("Unsupported filter type in pdf-filters: " + filterType);
        }
        final PsEncodeFilter encodeFilter = this.getPDFDocument().getPsServer().makeEncodeFilter(psFilterType,
                this.out);
        this.out = encodeFilter;
        this.filters.add(encodeFilter);
        return encodeFilter;
    }
View Full Code Here


        final List<String> names = new ArrayList<String>();
        final List<String> parms = new ArrayList<String>();

        /* Mark the filters as applied. */
        for (int i = 0; i < this.filters.size(); i++) {
            final PsEncodeFilter filter = this.filters.get(i);
            // place the names in our local List in reverse order
            names.add(0, filter.getDecodeName());
            parms.add(0, filter.getDecodeParms());
        }

        /* Build up the filter entries for the dictionary. */
        return buildFilterEntries(names) + buildDecodeParms(parms);
    }
View Full Code Here

     * @return An appropriate compression filter, or null if no compression should be used.
     * @exception GraphicException For error reading Graphic file.
     */
    private PsEncodeFilter getFilter(final OutputStream outputStream) throws GraphicException {
        final PsServer psServer = this.getPDFDocument().getPsServer();
        PsEncodeFilter filter = null;
        final Graphic graphic = this.getGraphic();
        if (graphic.getGraphicType() == Graphic.Type.JPEG) {
            filter = psServer.makeEncodeFilter(PsFilterType.DCT, outputStream);
            filter.setInactive();
            return filter;
        }
        if (graphic.getGraphicType() == Graphic.Type.TIFF) {
            final Graphic.Compression imageCompression
                    = graphic.getCompressionType();
            switch (imageCompression) {
            case UNCOMPRESSED:
                return null;
            case CCITT_GROUP_3:
                filter = psServer.makeEncodeFilter(PsFilterType.CCITT_FAX, outputStream);
                filter.setInactive();
                return filter;
            case CCITT_GROUP_4:
                filter = psServer.makeEncodeFilter(PsFilterType.CCITT_FAX, outputStream);
                filter.setInactive();
                filter.setDecodeParms("<< /K -1 /Columns " + graphic.pixelWidth() + " >>");
                return filter;
            case JPEG:
                filter = psServer.makeEncodeFilter(PsFilterType.DCT, outputStream);
                filter.setInactive();
                return filter;
            default:
                throw new GraphicException("Error while loading image "
                        + graphic.getUrl() + " : "
                        + this.getClass() + " - "
View Full Code Here

        }
        final PsServer psServer = this.getReader().getFontServer().getPsServer();
        switch (outputFormat) {
        case ASCII_HEX: {
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            final PsEncodeFilter filter = psServer.makeEncodeFilter(outputFormat, baos);
            filter.setLineLength(Type1PFBFile.DEFAULT_LINE_LENGTH);
            filter.write(unEncoded, 0, unEncoded.length);
            return baos.toByteArray();
        }
        default: {
            return null;
        }
View Full Code Here

TOP

Related Classes of org.axsl.ps.PsEncodeFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.