Examples of FormObject


Examples of org.jpedal.objects.raw.FormObject

      Map forms = compData.getRawFormData();

      //if some forms exist iterate over them
      if(forms.size()>1){
        Iterator formsIter = forms.keySet().iterator();
        FormObject form;
        while(formsIter.hasNext()){
          form = (FormObject) forms.get(formsIter.next());
          if (form != null){
           
            //check to see if the text color has changed
            if(form.hasColorChanged()){
              //update to the new color
              compData.setTextColor(form.getObjectRefAsString(), form.getTextColor());
              compData.invalidate(form.getTextStreamValue(PdfDictionary.T));
             
              // reset color changed, so we dant do it again unless needed
              form.resetColorChanged();
            }

            // if the form has changed reload the values into the display object
            if(form.hasValueChanged()){
            //dont set unformatted value here
            String objRef = form.getObjectRefAsString();
            compData.setUnformattedValue(objRef, compData.getValue(objRef));
            //dont set the last valid value as were not sure if it is valid
           
            //change the values within the componentData
            compData.setValue(form.getObjectRefAsString(), form.getValue(), false, false);

               
                      compData.invalidate(form.getTextStreamValue(PdfDictionary.T));

                        // reset values changed so we dant do it again unless needed
              form.resetFormChanged();
            }

          //check to see if the display has chnaged
            if(form.hasDisplayChanged()){

              boolean[] characteristic = form.getCharacteristics();
              //check if the form should be hidden, or shown now
                  if (characteristic[0] || characteristic[1] || characteristic[5]) {
                      compData.setCompVisible(form.getObjectRefAsString(),false);
                  }else {
                    compData.setCompVisible(form.getObjectRefAsString(),true);
                  }
            }
          }
        }
      }
View Full Code Here

Examples of org.jpedal.objects.raw.FormObject

        //rearrange heap into a sorted array
        while (right > 0) {

            //assert: largest unsorted value is at a[0]
            //move largest item to right end
          FormObject tempA = array[0];
            array[0] = array[right];
            array[right] = tempA;
            //assert: a[right..] is sorted

            //right is largest and sorted decrement it
View Full Code Here

Examples of org.jpedal.objects.raw.FormObject

     * see sortCompsDesending(Component[])
     * This Is Called from That Method ONLY
     */
    private static void siftCompsDesending(FormObject[] array, int left, int right) {
        int currentLeft;
        FormObject primaryTMP;
        int childL;

        //assign left to local
        currentLeft = left;
        //temp store of left item
View Full Code Here

Examples of org.jpedal.objects.raw.FormObject

                    DefaultMutableTreeNode blank = new DefaultMutableTreeNode("The following signature fields are not signed");

                    while(signatureObjects.hasNext()){

                        FormObject formObj = (FormObject) signatureObjects.next();

                        PdfObject sigObject=formObj.getDictionary(PdfDictionary.V);

                        decode_pdf.getIO().checkResolved(formObj);

                        if(sigObject == null){

                            if(!blank.isNodeChild(root))
                                root.add(blank);

                            DefaultMutableTreeNode blankNode = new DefaultMutableTreeNode(formObj.getTextStreamValue(PdfDictionary.T)+ " on page " + formObj.getPageNumber());
                            blank.add(blankNode);

                        } else {

                            if(!signed.isNodeChild(root))
                                root.add(signed);

                            //String name = (String) OLDsigObject.get("Name");

                            String name=sigObject.getTextStreamValue(PdfDictionary.Name);

                            DefaultMutableTreeNode owner = new DefaultMutableTreeNode("Signed by " + name);
                            signed.add(owner);

                            DefaultMutableTreeNode type = new DefaultMutableTreeNode("Type");
                            owner.add(type);

                            String filter = null;//sigObject.getName(PdfDictionary.Filter);

                            //@simon -new version to test
                            PdfArrayIterator filters = sigObject.getMixedArray(PdfDictionary.Filter);
                            if(filters!=null && filters.hasMoreTokens())
                                filter=filters.getNextValueAsString(true);

                            DefaultMutableTreeNode filterNode = new DefaultMutableTreeNode("Filter: " + filter);
                            type.add(filterNode);

                            String subFilter = sigObject.getName(PdfDictionary.SubFilter);

                            DefaultMutableTreeNode subFilterNode = new DefaultMutableTreeNode("Sub Filter: " + subFilter);
                            type.add(subFilterNode);

                            DefaultMutableTreeNode details = new DefaultMutableTreeNode("Details");
                            owner.add(details);


                            //@simon - guess on my part....
                            String rawDate=sigObject.getTextStreamValue(PdfDictionary.M);
                            //if(rawDate!=null){

                                StringBuilder date = new StringBuilder(rawDate);

                                date.delete(0, 2);
                                date.insert(4, '/');
                                date.insert(7, '/');
                                date.insert(10, ' ');
                                date.insert(13, ':');
                                date.insert(16, ':');
                                date.insert(19, ' ');

                                DefaultMutableTreeNode time = new DefaultMutableTreeNode("Time: " +date);
                                details.add(time);
                            //}

                            String reason=sigObject.getTextStreamValue(PdfDictionary.Reason);

                            DefaultMutableTreeNode reasonNode = new DefaultMutableTreeNode("Reason: " + reason);
                            details.add(reasonNode);

                            String location=sigObject.getTextStreamValue(PdfDictionary.Location);

                            DefaultMutableTreeNode locationNode = new DefaultMutableTreeNode("Location: " + location);
                            details.add(locationNode);

                            DefaultMutableTreeNode field = new DefaultMutableTreeNode("Field: " + formObj.getTextStreamValue(PdfDictionary.T)+ " on page " + formObj.getPageNumber());
                            details.add(field);
                        }
                    }
                    if(signaturesTree==null){
                        signaturesTree = new JTree();
View Full Code Here

Examples of org.jpedal.objects.raw.FormObject

                        //number of components - may be several child items
                        //int count = comp.length;

                        //take value or first if array to check for types (will be same if children)
                        FormObject formObj = null;

                        //extract list of actual PDF references to display and get FormObject
                        String PDFrefs = "PDF ref=";

                        JLabel ref = new JLabel();

                        //actual data read from PDF
                        Object[] rawFormData = formData.getRawForm(formName);
                        int objCount = rawFormData.length;
                        for (Object aRawFormData : rawFormData) {
                            formObj = (FormObject) aRawFormData;
                            PDFrefs = PDFrefs + ' ' + formObj.getObjectRefAsString();
                        }

                        ref.setText(PDFrefs);

                        /** display the form component description */
                        // int formComponentType = ((Integer) formData.getTypeValueByName(formName)).intValue();

                        String formDescription = formName;
                        JLabel header = new JLabel(formDescription);

                        JLabel type = new JLabel();
                        type.setText("Type=" +
                                PdfDictionary.showAsConstant(formObj.getParameterConstant(PdfDictionary.Type)) +
                                " Subtype=" + PdfDictionary.showAsConstant(formObj.getParameterConstant(PdfDictionary.Subtype)));


                        /** get the current Swing component type */
                        String standardDetails = "java class=" + comp[0].getClass();

View Full Code Here

Examples of org.jpedal.objects.raw.FormObject

    //look for a match
    if(objs!=null){

      //new code to check for match
      Iterator objKeys=objs.keySet().iterator();
      FormObject annotObj=null;
      while(objKeys.hasNext()){
        annotObj=(FormObject) objKeys.next();
        if(annotObj.getBoundingRectangle().contains(x,y)){
          break;
        }

        //reset to null so when exits no match
        annotObj=null;
      }

      /**action for moved over of clicked*/
      if(annotObj!=null){

        /**
         * get EF object containing file data
         */
        //annotObj is now actual object (on lazy initialisation so EF has not been read).....

        System.out.println(mouseClicked+" obj="+annotObj+ ' ' +annotObj.getObjectRefAsString()+ ' ' +annotObj.getBoundingRectangle());

        //@annot - in my example, ignore if not clicked
        if(!mouseClicked)
          return;

        //FS obj contains an EF obj which contains an F obj with the data in
        //F can be various - we are only interested in it as a Dictionary with a stream
        PdfObject EFobj=null, FSobj=annotObj.getDictionary(PdfDictionary.FS);
        if(FSobj!=null)
          EFobj=FSobj.getDictionary(PdfDictionary.EF);

        /**
         * create the file chooser to select the file name
View Full Code Here

Examples of org.jpedal.objects.raw.FormObject

        Object[] rawObj=decode_pdf.getFormRenderer().getCompData().getRawForm(annotKey);

                for (Object aRawObj : rawObj) {
                    if (aRawObj != null) {
                        FormObject annotObj = (FormObject) aRawObj;


                        //get the FS value
                        //PdfObject FS=annotObj.getDictionary(PdfDictionary.FS);

                        //and the text
                        //                    if(FS!=null){
                        //                        System.out.println("----"+annotObj.getObjectRefAsString());
                        //                        System.out.println("Contents="+annotObj.getTextStreamValue(PdfDictionary.Contents));
                        //                        System.out.println("F="+FS.getTextStreamValue(PdfDictionary.F));
                        //                        System.out.println("D="+FS.getTextStreamValue(PdfDictionary.D));
                        //                    }

                        int subtype = annotObj.getParameterConstant(PdfDictionary.Subtype);

                        //                    if(subtype==PdfDictionary.Link){
                        //                        System.out.println("----"+annotObj.getObjectRefAsString());
                        //                        PdfObject Aobj=annotObj.getDictionary(PdfDictionary.A);
                        //                       System.out.println("A="+Aobj+" "+subtype);
                        //                        PdfObject winObj=Aobj.getDictionary(PdfDictionary.Win);
                        //                        System.out.println("Win="+winObj+" "+winObj.getTextStreamValue(PdfDictionary.D)+" "+winObj.getTextStreamValue(PdfDictionary.P));
                        //
                        //                    }
                        //subtypes set in PdfDictionary - please use Constant as values may change
                        //if not present ask me and I will add
                        if (subtype == PdfDictionary.FileAttachment) { //might also be PdfDictionary.Link

                            //@annot -save so we can lookup (kept as HashMap siply to reduce changes and in case
                            //we want something else as value. Could be Set or Vector
                            objs.put(annotObj, "x");

                            Color col = Color.BLUE;

                            //get origin of Form Object
                            Rectangle location = annotObj.getBoundingRectangle();

                            //SOME EXAMPLES to show other possible uses

                            //example stroked shape
                            //                  type[i]= org.jpedal.render.DynamicVectorRenderer.STROKEDSHAPE;
View Full Code Here

Examples of org.jpedal.objects.raw.FormObject

        PdfDecoder decodePdf = pdfDecoder;
        Map i = decodePdf.getFormRenderer().getCompData().getRawFormData();
        Set keys = i.keySet();
        allFormObjectPositions = new HashMap<Long, Vector<FormObject>>();
        for (Object key : keys) {
            FormObject frmOb = (FormObject) i.get(key);
            SrcPosition srcpos = new SrcPosition(frmOb);
            if (srcpos.valid) {
                try {
                    long position = srcpos.line * 10000 + srcpos.from;
                    Vector<FormObject> frms = new Vector<FormObject>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.