Examples of PDFParseException


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();
        center1 = new Point2D.Float(coords[0].getFloatValue(),
                                          coords[1].getFloatValue());
        center2 = new Point2D.Float(coords[3].getFloatValue(),
                                          coords[4].getFloatValue());
        radius1 = coords[2].getFloatValue();
        radius2 = coords[5].getFloatValue();
       
        // 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 nz.govt.natlib.adapter.pdf.PDFParseException

    if (id == -1) {
      id = ((IntegerNode) value).getIntValue();
    } else if (version == -1) {
      version = ((IntegerNode) value).getIntValue();
    } else {
      throw new PDFParseException("too many objects for a reference");
    }
  }
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.