Examples of PDFParseException


Examples of com.sun.pdfview.PDFParseException

        }
       
        // read the type (required)
        PDFObject typeObj = shaderObj.getDictRef("ShadingType");
        if (typeObj == null) {
            throw new PDFParseException("No shader type defined!");
        }
        int type = typeObj.getIntValue();
       
        // create the shader
        switch (type) {
            case AXIAL_SHADING:
                shader = new ShaderType2();
                break;
   
            case FUNCTION_SHADING:
            case RADIAL_SHADING:
            case FREE_FORM_SHADING:
            case LATTICE_SHADING:
            case COONS_PATCH_MESH_SHADING:
            case TENSOR_PRODUCTS_MESH_SHADING:
            default:   
                throw new PDFParseException("Unsupported shader type: " + type);
        }
       
        // read the color space (required)
        PDFObject csObj = shaderObj.getDictRef("ColorSpace");
        if (csObj == null) {
            throw new PDFParseException("No colorspace defined!");
        }
        PDFColorSpace cs = PDFColorSpace.getColorSpace(csObj, resources);
        shader.setColorSpace(cs);
       
        // read the background color (optional)
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

            byte[] fontdata = ttf.getStream ();

            try {
                setFont (fontdata);
            } catch (FontFormatException ffe) {
                throw new PDFParseException ("Font format exception: " + ffe);
            }
        } else {
            int flags = descriptor.getFlags ();
            int style = ((flags & PDFFontDescriptor.FORCEBOLD) != 0) ? Font.BOLD : Font.PLAIN;
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

    public void parse(PDFObject shaderObj) throws IOException
    {
        // read the axis coordinates (required)
        PDFObject coordsObj = shaderObj.getDictRef("Coords");
        if (coordsObj == null) {
            throw new PDFParseException("No coordinates found!");
        }
        PDFObject[] coords = coordsObj.getArray();
        Point2D start = new Point2D.Float(coords[0].getFloatValue(),
                                          coords[1].getFloatValue());
        Point2D end   = new Point2D.Float(coords[2].getFloatValue(),
                                          coords[3].getFloatValue());
        setAxisStart(start);
        setAxisEnd(end);
       
        // read the domain (optional)
        PDFObject domainObj = shaderObj.getDictRef("Domain");
        if (domainObj != null) {
            PDFObject[] domain = domainObj.getArray();
            setMinT(domain[0].getFloatValue());
            setMaxT(domain[1].getFloatValue());
        }
       
        // read the functions (required)
        PDFObject functionObj = shaderObj.getDictRef("Function");
        if (functionObj == null) {
            throw new PDFParseException("No function defined for shader!");
        }
        PDFObject[] functionArray = functionObj.getArray();
        PDFFunction[] functions = new PDFFunction[functionArray.length];
        for (int i = 0; i < functions.length; i++) {
            functions[i] = PDFFunction.getFunction(functionArray[i]);
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

        switch (type) {
            case 1:
                pattern = new PatternType1();
                break;
            default:
                throw new PDFParseException("Unknown pattern type " + type);
        }      
       
        // set the transform
        pattern.setTransform(xform);
       
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

            PDFParser form = new PDFParser(formCmds, obj.getStream(), r);
            form.go(true);

            result.addAll(formCmds.getCommands());
        } else {
            throw new PDFParseException("Unknown XObject subtype: " + type);
        }
        result.add(PDFPage.createPopCmd());
        result.add(PDFPage.createPopCmd());
        return result;
  }
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

        dest = annotObject.getDictRef("DEST");
      }
      if (dest != null) {
        this.action = new GoToAction(PDFDestination.getDestination(dest, annotObject.getRoot()));
      } else {
        throw new PDFParseException(
          "Could not parse link annotation (no Action or Destination found): "
            + annotObject.toString());
      }
    }
  }
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

            PDFParser form = new PDFParser(formCmds, obj.getStream(), r);
            form.go(true);

            result.addAll(formCmds.getCommands());
        } else {
            throw new PDFParseException("Unknown XObject subtype: " + type);
        }
        result.add(PDFPage.createPopCmd());
        result.add(PDFPage.createPopCmd());
        return result;
  }
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

    Constructor<?> constructor;
    try {
      constructor = className.getConstructor(PDFObject.class);
      return (PDFAnnotation)constructor.newInstance(parent);
    } catch (Exception e) {
      throw new PDFParseException("Could not parse annotation!", e);
    }
  }
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

                return new Rectangle2D.Float(bounds[0].getFloatValue(),
                        bounds[1].getFloatValue(),
                        bounds[2].getFloatValue() - bounds[0].getFloatValue(),
                        bounds[3].getFloatValue() - bounds[1].getFloatValue());
            } else {
                throw new PDFParseException("Rectangle definition didn't have 4 elements");
            }
        } else {
            throw new PDFParseException("Rectangle definition not an array");
        }
    }
View Full Code Here

Examples of com.sun.pdfview.PDFParseException

                } else {
                    throw new EncryptionUnsupportedByPlatformException(
                            "Unsupported encryption version: " + v);
                }
            } else if (filter == null) {
                throw new PDFParseException(
                        "No Filter specified in Encrypt dictionary");
            } else {
                throw new EncryptionUnsupportedByPlatformException(
                        "Unsupported encryption Filter: " + filter +
                                "; only Standard is supported.");
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.