Package org.jpedal.grouping

Examples of org.jpedal.grouping.PdfGroupingAlgorithms


                String extractedText;

                try {
                    /** create a grouping object to apply grouping to data */
                    PdfGroupingAlgorithms currentGrouping = decode_pdf.getGroupingObject();

                    //switch off display - pops up again if help selected
                    display = false;


                    /**get the text*/
                    extractedText = currentGrouping.extractTextInRectangle(
                            t_x1, t_y1, t_x2, t_y2, commonValues.getCurrentPage(), false,
                            true);

                    /**
                     * find out if xml or text - as we need to turn xml off before
View Full Code Here


          }
          //decode the page
          decode_pdf.decodePage(page);
         
          /** create a grouping object to apply grouping to data*/
          PdfGroupingAlgorithms currentGrouping =decode_pdf.getGroupingObject();
         
          /**use whole page size for  demo - get data from PageData object*/
          PdfPageData currentPageData = decode_pdf.getPdfPageData();
         
          int x1,y1,x2,y2;
         
          x1 = currentPageData.getMediaBoxX(page);
          x2 = currentPageData.getMediaBoxWidth(page)+x1;
         
          y2 = currentPageData.getMediaBoxY(page);
          y1 = currentPageData.getMediaBoxHeight(page)+y2;
         
          //default for xml
          String ending="_text.csv";
         
          if(useXMLExtraction)
            ending="_xml.txt";
         
          /**Co-ordinates are x1,y1 (top left hand corner), x2,y2(bottom right) */
         
          /**The call to extract the table*/
          Map tableContent =null;
          String tableText=null;
         
          try{
            //the source code for this grouping is in the customer area
            //in class pdfGroupingAlgorithms
            //all these settings are defined in the Java
           
            tableContent =currentGrouping.extractTextAsTable(
                x1,
                y1,
                x2,
                y2,
                page,
View Full Code Here

          }
          //decode the page
          decode_pdf.decodePage(page);
         
          /** create a grouping object to apply grouping to data*/
          PdfGroupingAlgorithms currentGrouping =decode_pdf.getGroupingObject();
         
          /**use whole page size for  demo - get data from PageData object*/
          PdfPageData currentPageData = decode_pdf.getPdfPageData();
         
          int x1 = currentPageData.getMediaBoxX(page);
          int x2 = currentPageData.getMediaBoxWidth(page)+x1;
         
          int y2 = currentPageData.getMediaBoxX(page);
          int y1 = currentPageData.getMediaBoxHeight(page)-y2;
         
          /**Co-ordinates are x1,y1 (top left hand corner), x2,y2(bottom right) */
         
          /**The call to extract the list*/
          List words =null;
         
          try{
            words =currentGrouping.extractTextAsWordlist(
                x1,
                y1,
                x2,
                y2,
                page,
View Full Code Here

          }
          //decode the page
          decode_pdf.decodePage(page);
         
          /** create a grouping object to apply grouping to data*/
          PdfGroupingAlgorithms currentGrouping =decode_pdf.getGroupingObject();
         
          /**use whole page size for  demo - get data from PageData object*/
          PdfPageData currentPageData = decode_pdf.getPdfPageData();
         
          int x1 = currentPageData.getMediaBoxX(page);
          int x2 = currentPageData.getMediaBoxWidth(page)+x1;
         
          int y2 = currentPageData.getMediaBoxY(page);
          int y1 = currentPageData.getMediaBoxHeight(page)+y2;
         
          /**Co-ordinates are x1,y1 (top left hand corner), x2,y2(bottom right) */
         
          /**The call to extract the text*/
          String text =null;
         
          try{
            text =currentGrouping.extractTextInRectangle(
                x1,
                y1,
                x2,
                y2,
                page,
View Full Code Here

            //PUT BACK when we remove params
            //PdfData textData = getPdfData();
            if (textData == null)
                return null;
            else
                return new PdfGroupingAlgorithms(textData, pageData,isXMLExtraction);
        }
    }
View Full Code Here

        PdfData textData = pdfBackgroundData;
        if (textData == null)
            return null;
        else
            return new PdfGroupingAlgorithms(textData, pageData, isXMLExtraction);
    }
View Full Code Here

            progress.setValue(progress.getValue()+1);
            decode_pdf.repaint();

            /** common extraction code */
            PdfGroupingAlgorithms currentGrouping;

            /** create a grouping object to apply grouping to data */
            try {
                if (page == commonValues.getCurrentPage())
                    currentGrouping = decode_pdf.getGroupingObject();
                else {
                    decode_pdf.decodePageInBackground(page);
                    currentGrouping = decode_pdf.getBackgroundGroupingObject();
                }

                // tell JPedal we want teasers
                currentGrouping.generateTeasers();

//allow us to add options
                currentGrouping.setIncludeHTML(true);

// set size
                x1 = pageSize.getCropBoxX(page);
                x2 = pageSize.getCropBoxWidth(page);
                y1 = pageSize.getCropBoxY(page);
                y2 = pageSize.getCropBoxHeight(page);

                final SearchListener listener = new DefaultSearchListener();

                SortedMap highlightsWithTeasers = currentGrouping.findMultipleTermsInRectangleWithMatchingTeasers(x1, y1, x2, y2, pageSize.getRotation(page), page, searchTerms, searchTypeParameters, listener);

//changed by MArk
                if (Thread.interrupted()) {
                    continue;
                    //throw new InterruptedException();
View Full Code Here

    PdfDecoder.setFontReplacements(pdf);
    pdf.openPdfFile(pdfFile.toString());
    pdf.setPageParameters(zoom, pageNum);
    pdf.decodePage(pageNum);
    BufferedImage pdfImage = pdf.getPageAsImage(pageNum);
    PdfGroupingAlgorithms grouping = pdf.getGroupingObject();
    PdfPageData page = pdf.getPdfPageData();
    int x1 = page.getMediaBoxX(pageNum);
    int x2 = page.getMediaBoxWidth(pageNum);
    int y1 = page.getMediaBoxY(pageNum);
    int y2 = page.getMediaBoxHeight(pageNum);
    final SearchListener listener = new DefaultSearchListener();
    List<Rectangle> highlights = grouping.findMultipleTermsInRectangle(
        x1, y1, x2, y2,
        page.getRotation(pageNum),
        pageNum,
        highlightTerms,
        true, SearchType.DEFAULT, listener);
View Full Code Here

TOP

Related Classes of org.jpedal.grouping.PdfGroupingAlgorithms

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.