Examples of XObject


Examples of org.pdfclown.documents.contents.xObjects.XObject

        */
        Dimension2D imageSize = null; // Image native size.
        if(objectWrapper instanceof ContentScanner.XObjectWrapper)
        {
          ContentScanner.XObjectWrapper xObjectWrapper = (ContentScanner.XObjectWrapper)objectWrapper;
          XObject xObject = xObjectWrapper.getXObject();
          // Is the external object an image?
          if(xObject instanceof ImageXObject)
          {
            System.out.print(
              "External Image '" + xObjectWrapper.getName() + "' (" + xObject.getBaseObject() + ")" // Image key and indirect reference.
              );
            imageSize = xObject.getSize(); // Image native size.
          }
        }
        else if(objectWrapper instanceof ContentScanner.InlineImageWrapper)
        {
          System.out.print("Inline Image");
View Full Code Here

Examples of org.pdfclown.documents.contents.xObjects.XObject

    )
  {
    // Get the image used to replace existing ones!
    Image image = Image.get(getInputPath() + java.io.File.separator + "images" + java.io.File.separator + "gnu.jpg"); // Image is an abstract entity, as it still has to be included into the pdf document.
    // Add the image to the document!
    XObject imageXObject = image.toXObject(document); // XObject (i.e. external object) is, in PDF spec jargon, a reusable object.
    // Looking for images to replace...
    for(Page page : document.getPages())
    {
      Resources resources = page.getResources();
      XObjectResources xObjects = resources.getXObjects();
      if(xObjects == null)
        continue;

      for(PdfName xObjectKey : xObjects.keySet())
      {
        XObject xObject = xObjects.get(xObjectKey);
        // Is the page's resource an image?
        if(xObject instanceof ImageXObject)
        {
          System.out.println("Substituting " + xObjectKey + " image xobject.");
          xObjects.put(xObjectKey,imageXObject);
View Full Code Here

Examples of org.pdfclown.documents.contents.xObjects.XObject

    // 2. Instantiate a new PDF file!
    File file = new File();
    Document document = file.getDocument();

    // 3. Convert the first page of the source file into a form inside the new document!
    XObject form = formFile.getDocument().getPages().get(0).toXObject(document);

    // 4. Insert the contents into the new document!
    populate(document,form);

    // (boilerplate metadata insertion -- ignore it)
View Full Code Here

Examples of org.pdfclown.documents.contents.xObjects.XObject

    )
  {
    // Get the abstract barcode entity!
    EAN13Barcode barcode = new EAN13Barcode("8012345678901");
    // Create the reusable barcode within the document!
    XObject barcodeXObject = barcode.toXObject(document);

    Pages pages = document.getPages();
    // Page 1.
    {
      Page page = new Page(document);
View Full Code Here

Examples of org.xmldb.common.xml.queries.XObject

                            select = select.substring(0, select.indexOf("\""));
                            getLogger().debug(".act() Select Node: " + select);

                            // Check if node exists
                            xpath.setQString(select);
                            XObject result = xpath.execute(document);
                            NodeList selectionNodeList = result.nodeset();
                            if (selectionNodeList.getLength() == 0) {
                                getLogger()
                                        .debug(".act(): Node does not exist (might have been deleted during update): "
                                                + select);
                            } else {
View Full Code Here

Examples of xscript.runtime.object.XObject

  }

  public void call(XThread thread, XMethodExecutor methodExecutor, XMethod method, XGenericClass[] generics, long[] params) {
    XNativeMethod nativeMethod = method.getNativeMethod();
   
    XObject _this = null;
    int i=0;
    if(!XModifier.isStatic(method.getModifier())){
      _this = virtualMachine.getObjectProvider().getObject(params[0]);
      i=1;
    }
    Object[] oParam = new Object[params.length-i];
    XGenericClass[] genericClasses = method.getParams(_this==null?null:_this.getXClass(), new XGenericMethodProviderImp(method, generics));
    if(oParam.length!=genericClasses.length)
      throw new XRuntimeException("An native call error happened");
    for(int j=0; j<oParam.length; j++){
      long value = params[j+i];
      XGenericClass genericClass = genericClasses[j];
      oParam[j] = XWrapper.getJavaObject(virtualMachine.getObjectProvider(), genericClass, value);
    }
   
    Object ret = invokeNative(nativeMethod, thread, methodExecutor, generics, _this, oParam);
    XGenericClass genericClass  = method.getReturnType(_this==null?null:_this.getXClass(), new XGenericMethodProviderImp(method, generics));
    if(XPrimitive.getPrimitiveID(genericClass.getXClass())!=XPrimitive.VOID){
      long l = XWrapper.getXObject(virtualMachine.getObjectProvider(), genericClass, ret);
      methodExecutor.push(l, XPrimitive.getPrimitiveID(genericClass.getXClass()));
    }
  }
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.