com.aspose.pdf.devices

Class DocumentDevice

  • Direct Known Subclasses:
    TiffDevice


    public abstract class DocumentDevice
    extends Device

    Abstract class for all devices which is used to process the whole pdf document.

    • Constructor Detail

      • DocumentDevice

        public DocumentDevice()
    • Method Detail

      • processInternal

        public abstract void processInternal(IDocument document,
                                             int fromPage,
                                             int toPage,
                                             com.aspose.ms.System.IO.Stream output)

        Each device represents some operation on the document, e.g. we can convert pdf document into another format.

        Parameters:
        document - The document to process.
        fromPage - Defines the page from which to start processing.
        toPage - Defines the last page to process.
        output - Defines stream where the results of processing are stored.
      • process

        public void process(IDocument document,
                            int fromPage,
                            int toPage,
                            OutputStream output)

        Each device represents some operation on the document, e.g. we can convert pdf document into another format.

        Parameters:
        document - The document to process.
        fromPage - Defines the page from which to start processing.
        toPage - Defines the last page to process.
        output - Defines stream where the results of processing are stored.
      • process

        public void process(IDocument document,
                            int fromPage,
                            int toPage,
                            com.aspose.ms.System.IO.Stream output)
      • processInternal

        public void processInternal(IDocument document,
                                    com.aspose.ms.System.IO.Stream output)

        Processes the whole document and saves results into stream.

        Parameters:
        document - The document to process.
        output - Defines stream where the results of processing are stored.
      • process

        public void process(IDocument document,
                            OutputStream output)

        Processes the whole document and saves results into stream.

        Parameters:
        document - The document to process.
        output - Defines stream where the results of processing are stored.
      • process

        public void process(IDocument document,
                            String outputFileName)

        Processes the whole document and saves results into file.

        Parameters:
        document - The document to process.
        outputFileName - Defines file where the results of processing are stored.
      • process

        public void process(IDocument document,
                            int fromPage,
                            int toPage,
                            String outputFileName)

        Processes certain pages of the document and saves results into file.

        Parameters:
        document - The document to process.
        fromPage - The first page to start processing.
        toPage - The last page of processing.
        outputFileName - Defines file where the results of processing are stored.
      • binarizeBradley

        public void binarizeBradley(InputStream inputImageStream,
                                    OutputStream outputImageStream,
                                    double threshold)

        Do Bradley binarization for input stream.

        Parameters:
        inputImageStream - The input image stream.
        outputImageStream - The output image stream.
        threshold - The threshold value between 0.0 and 1.0.