Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfDictionary


      // 1. Header.
      stream.write(TrailerChunk);

      // 2. Body.
      // Update its entries:
      PdfDictionary trailer = file.getTrailer();
      // * Size
      trailer.put(PdfName.Size,new PdfInteger(xrefSize));
      // * Prev
      if(parser == null)
      {trailer.remove(PdfName.Prev);} // [FIX:0.0.4:5] It (wrongly) kept the 'Prev' entry of multiple-section xref tables.
      else
      {trailer.put(PdfName.Prev,new PdfInteger((int)parser.retrieveXRefOffset()));}
      // Serialize its contents!
      trailer.writeTo(stream); stream.write(Chunk.LineFeed);

      // 3. Tail.
      writeTail(startxref);
    }
    catch(Exception e)
View Full Code Here


    )
  {
    /*
      NOTE: 'Win' entry may be undefined.
    */
    PdfDictionary parametersObject = (PdfDictionary)getBaseDataObject().get(PdfName.Win);
    if(parametersObject == null)
      return null;

    return new WinParametersObject(parametersObject,getContainer());
  }
View Full Code Here

      String fileName
      )
    {
      super(
        context.getFile(),
        new PdfDictionary()
        );

      setFileName(fileName);
    }
View Full Code Here

    )
  {
    if(reference == null)
      return null;

    PdfDictionary dataObject = (PdfDictionary)reference.getDataObject();
    PdfName fieldType = (PdfName)dataObject.get(PdfName.FT);
    PdfInteger fieldFlags = (PdfInteger)dataObject.get(PdfName.Ff);
    int fieldFlagsValue = (fieldFlags == null ? 0 : fieldFlags.getRawValue());
    if(fieldType.equals(PdfName.Btn)) // Button.
    {
      if((fieldFlagsValue & FlagsEnum.Pushbutton.getCode()) > 0) // Pushbutton.
        return new PushButton(reference);
View Full Code Here

    Widget widget
    )
  {
    this(widget.getBaseObject());

    PdfDictionary baseDataObject = getBaseDataObject();
    baseDataObject.put(PdfName.FT, fieldType);
    baseDataObject.put(PdfName.T, new PdfTextString(name));
  }
View Full Code Here

  {
    StringBuilder buffer = new StringBuilder();
    {
      Stack<String> partialNameStack = new Stack<String>();
      {
        PdfDictionary parent = getBaseDataObject();
        while(parent != null)
        {
          partialNameStack.push(((PdfTextString)parent.get(PdfName.T)).getValue());
          parent = (PdfDictionary)parent.resolve(PdfName.Parent);
        }
      }
      while(!partialNameStack.isEmpty())
      {
        if(buffer.length() > 0)
View Full Code Here

      NOTE: As flags may be inherited from a parent field dictionary,
      we MUST ensure that the change will affect just this one;
      so, if such flags are implicit (inherited), they MUST be cloned
      and explicitly assigned to this field in order to apply changes.
    */
    PdfDictionary baseDataObject = getBaseDataObject();
    PdfInteger entry = (PdfInteger)baseDataObject.get(PdfName.Ff);
    if(entry == null) // Implicit flags.
    {
      // Clone the inherited attribute in order to restrict its change to this field's scope only!
      entry = (PdfInteger)getInheritableAttribute(PdfName.Ff).clone(getFile());
      // Associate the cloned attribute to this field's dictionary!
      baseDataObject.put(PdfName.Ff,entry);
    }

    entry.setRawValue(FlagsEnum.toInt(value));
  }
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)
        );
      if(dictionary == null)
      {
        if(key.equals(PdfName.Ff))
          return new PdfInteger(0);
View Full Code Here

    )
  {
    return new ImageXObject(
      context,
      new PdfStream(
        new PdfDictionary(
          new PdfName[]
          {
            PdfName.Width,
            PdfName.Height,
            PdfName.BitsPerComponent,
View Full Code Here

    Document context
    )
  {
    super(
      context.getFile(),
      new PdfDictionary()
      );
  }
View Full Code Here

TOP

Related Classes of org.pdfclown.objects.PdfDictionary

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.