Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfDirectObject


    )
  {
    /*
      NOTE: 'WS' entry may be undefined.
    */
    PdfDirectObject beforeSaveObject = getBaseDataObject().get(PdfName.WS);
    if(beforeSaveObject == null)
      return null;

    return Action.wrap(beforeSaveObject,getContainer());
  }
View Full Code Here


    )
  {
    /*
      NOTE: 'DC' entry may be undefined.
    */
    PdfDirectObject onCloseObject = getBaseDataObject().get(PdfName.DC);
    if(onCloseObject == null)
      return null;

    return Action.wrap(onCloseObject,getContainer());
  }
View Full Code Here

    )
  {
    /*
      NOTE: 'OpenAction' entry may be undefined.
    */
    PdfDirectObject onOpenObject = getDocument().getBaseDataObject().get(PdfName.OpenAction);
    if(onOpenObject == null)
      return null;

    if(onOpenObject instanceof PdfDictionary) // Action (dictionary).
      return Action.wrap(onOpenObject,getContainer());
View Full Code Here

      existing content representations, leveraging the peculiar feature of page structures
      to express their content streams as arrays of data streams.
    */
    PdfArray streams;
    {
      PdfDirectObject contentsObject = page.getBaseDataObject().get(PdfName.Contents);
      PdfDataObject contentsDataObject = File.resolve(contentsObject);
      // Single data stream?
      if(contentsDataObject instanceof PdfStream)
      {
        /*
 
View Full Code Here

  */
  @PDF(VersionEnum.PDF12)
  public PageActions getActions(
    )
  {
    PdfDirectObject actionsObject = getBaseDataObject().get(PdfName.AA);
    return actionsObject != null ? new PageActions(actionsObject, getContainer()) : null;
  }
View Full Code Here

    Gets the annotations associated to the page.
  */
  public PageAnnotations getAnnotations(
    )
  {
    PdfDirectObject annotationsObject = getBaseDataObject().get(PdfName.Annots);
    return annotationsObject != null ? new PageAnnotations(annotationsObject, getContainer(), this) : null;
  }
View Full Code Here

  */
  @PDF(VersionEnum.PDF11)
  public Transition getTransition(
    )
  {
    PdfDirectObject transitionObject = getBaseDataObject().get(PdfName.Trans);
    return transitionObject != null ? new Transition(transitionObject, getContainer()) : null;
  }
View Full Code Here

        PdfName.BBox,
        (PdfDirectObject)getInheritableAttribute(PdfName.MediaBox).clone(contextFile)
        );
      // Resources.
      {
        PdfDirectObject resourcesObject = getInheritableAttribute(PdfName.Resources);
        formHeader.put(
          PdfName.Resources,
          // Same document?
          /* NOTE: Try to reuse the resource dictionary whenever possible. */
          (context.equals(getDocument()) ?
            resourcesObject
            : (PdfDirectObject)resourcesObject.clone(contextFile))
          );
      }
    }

    // Body (contents).
View Full Code Here

      NOTE: It moves upward until it finds the inherited attribute.
    */
    PdfDictionary dictionary = getBaseDataObject();
    while(true)
    {
      PdfDirectObject entry = dictionary.get(key);
      if(entry != null)
        return entry;

      dictionary = (PdfDictionary)File.resolve(
        dictionary.get(PdfName.Parent)
View Full Code Here

    )
  {
    Page pageObj = (Page)page;
    PdfDictionary pageData = pageObj.getBaseDataObject();
    // Get the parent tree node!
    PdfDirectObject parent = pageData.get(PdfName.Parent);
    PdfDictionary parentData = (PdfDictionary)File.resolve(parent);
    // Get the parent's page collection!
    PdfDirectObject kids = parentData.get(PdfName.Kids);
    PdfArray kidsData = (PdfArray)File.resolve(kids);
    // Remove the page!
    kidsData.remove(pageObj.getBaseObject());
    boolean updateParent = !File.update(kids); // Try to update the page collection.
    // Unbind the page from its parent!
    pageData.put(PdfName.Parent,null);
    pageObj.update();
    // Decrementing the pages counters...
    do
    {
      // Get the page collection counter!
      PdfDirectObject count = parentData.get(PdfName.Count);
      PdfNumber<?> countData = (PdfNumber<?>)File.resolve(count);
      // Decrement the counter at the current level!
      countData.setValue(countData.getNumberValue()-1);
      updateParent |= !File.update(count); // Try to update the counter.
      // Is the parent tree node to be updated?
View Full Code Here

TOP

Related Classes of org.pdfclown.objects.PdfDirectObject

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.