コード例 #1
0
        /**
          <summary>Shows the specified external object.</summary>
          <param name="xObject">External object.</param>
          <param name="size">Size of the external object.</param>
          <param name="lineAlignment">Line alignment. It can be:
        <list type="bullet">
          <item><see cref="LineAlignmentEnum"/></item>
          <item><see cref="Length">: arbitrary super-/sub-script, depending on whether the value is
          positive or not.</item>
        </list>
          </param>
          <returns>Whether the external object was successfully shown.</returns>
        */
        public bool ShowXObject(
      xObjects::XObject xObject,
      SizeF? size,
      object lineAlignment
      )
        {
            if(currentRow == null
            || xObject == null)
            return false;

              if(!size.HasValue)
              {size = xObject.Size;}
              lineAlignment = ResolveLineAlignment(lineAlignment);

              while(true)
              {
            if(OperationUtils.Compare(currentRow.Y + size.Value.Height, frame.Height) == 1) // Object's height exceeds block's remaining vertical space.
            {
              // Terminate current row and exit!
              EndRow(false);
              return false;
            }
            else if(OperationUtils.Compare(currentRow.Width + size.Value.Width, frame.Width) < 1) // There's room for the object in the current row.
            {
              PointF location = new PointF(
            (float)currentRow.Width,
            (float)currentRow.Y
            );
              RowObject obj;
              {
            obj = new RowObject(
              RowObject.TypeEnum.XObject,
              baseComposer.BeginLocalState(), // Opens the row object's local state.
              size.Value.Height,
              size.Value.Width,
              0,
              lineAlignment,
              size.Value.Height
              );
            baseComposer.ShowXObject(xObject, location, size);
            baseComposer.End(); // Closes the row object's local state.
              }
              AddRowObject(obj, lineAlignment);

              return true;
            }
            else // There's NOT enough room for the object in the current row.
            {
              // Go to next row!
              EndRow(false);
              BeginRow();
            }
              }
        }
コード例 #2
0
   /**
     <summary>Shows the specified external object.</summary>
     <remarks>Default line alignment is applied.</remarks>
     <param name="xObject">External object.</param>
     <param name="size">Size of the external object.</param>
     <returns>Whether the external object was successfully shown.</returns>
   */
   public bool ShowXObject(
 xObjects::XObject xObject,
 SizeF? size
 )
   {
       return ShowXObject(xObject, size, lineAlignment);
   }