Package org.pdfclown.files

Examples of org.pdfclown.files.IndirectObjects


    int dataByteOffset;
    {
      // Serializing the entries into the stream buffer...
      IBuffer indexBuffer = new Buffer();
      IBuffer dataBuffer = new Buffer();
      IndirectObjects indirectObjects = file.getIndirectObjects();
      int objectIndex = -1;
      for(Map.Entry<Integer,ObjectEntry> entry : getEntries().entrySet())
      {
        final int objectNumber = entry.getKey();

        // Update the xref entry!
        XRefEntry xrefEntry = indirectObjects.get(objectNumber).getXrefEntry();
        xrefEntry.setOffset(++objectIndex);

        /*
          NOTE: The entry offset MUST be updated only after its serialization, in order not to interfere
          with its possible data-object retrieval from the old serialization.
View Full Code Here


      // 2. Body update (modified indirect objects insertion).
      XRefEntry xrefStreamEntry;
      {
        // 2.1. Content indirect objects.
        IndirectObjects indirectObjects = file.getIndirectObjects();

        // Create the xref stream indirect object!
        /*
          NOTE: Incremental xref table comprises multiple sections each one composed by multiple subsections;
          this update adds a new section.
        */
        /*
          NOTE: This xref stream indirect object is purposely temporary (i.e. not registered into the file's
          indirect objects collection).
        */
        XRefStream xrefStream;
        PdfIndirectObject xrefStreamIndirectObject = new PdfIndirectObject(
          file,
          xrefStream = new XRefStream(file),
          xrefStreamEntry = new XRefEntry(indirectObjects.size(), 0, 0, XRefEntry.UsageEnum.InUse)
          );

        XRefEntry prevFreeEntry = null;
        for(PdfIndirectObject indirectObject : indirectObjects.getModifiedObjects().values())
        {
          prevFreeEntry = addXRefEntry(
            indirectObject.getXrefEntry(),
            indirectObject,
            xrefStream,
View Full Code Here

      // 2. Body [PDF:1.6:3.4.2,3,7].
      XRefEntry xrefStreamEntry;
      {
        // 2.1. Content indirect objects.
        IndirectObjects indirectObjects = file.getIndirectObjects();

        // Create the xref stream indirect object!
        /*
          NOTE: A standard xref stream comprises just one section composed by just one subsection.
          The xref stream is generated on-the-fly and kept volatile not to interfere with the existing
          file structure.
        */
        /*
          NOTE: This xref stream indirect object is purposely temporary (i.e. not registered into the file's
          indirect objects collection).
        */
        XRefStream xrefStream;
        PdfIndirectObject xrefStreamIndirectObject = new PdfIndirectObject(
          file,
          xrefStream = new XRefStream(file),
          xrefStreamEntry = new XRefEntry(indirectObjects.size(), 0, 0, XRefEntry.UsageEnum.InUse)
          );

        XRefEntry prevFreeEntry = null;
        for(PdfIndirectObject indirectObject : indirectObjects)
        {
View Full Code Here

        the object number of the next free entry inside the previous one.
      */
      appendXRefSubsectionIndexer(xrefBuilder, 0, xrefSize);

      StringBuilder xrefInUseBlockBuilder = new StringBuilder();
      IndirectObjects indirectObjects = file.getIndirectObjects();
      PdfReference freeReference = indirectObjects.get(0).getReference(); // Initialized to the first free entry.
      for(
        int index = 1;
        index < xrefSize;
        index++
        )
      {
        // Current entry insertion.
        PdfIndirectObject indirectObject = indirectObjects.get(index);
        if(indirectObject.isInUse()) // In-use entry.
        {
          // Add in-use entry!
          appendXRefEntry(
            xrefInUseBlockBuilder,
View Full Code Here

TOP

Related Classes of org.pdfclown.files.IndirectObjects

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.