Class KeepPartAndCloneSolidObjectToNextPageAlgorithm

Class KeepPartAndCloneSolidObjectToNextPageAlgorithm

نام ها : Aspose.Note.Saving جمع آوری: Aspose.Note.dll (25.4.0)

اضافه کردن قسمت بالای اشیاء به پایین صفحه و کلون کردن کلین به صفحه بعدی در صورتی که آن را در صفحه اصلی مناسب نیست.

public class KeepPartAndCloneSolidObjectToNextPageAlgorithm : PageSplittingAlgorithm
   {
      private bool _keepWithNext;
      private Shape _clonedShape;
      public KeepPartAndCloneSolidObjectToNextPageAlgorithm()
      {
         _keepWithNext = false;
         _clonedShape = null;
      }
      protected override bool ShouldSplit(Node node)
      {
         if (node is Shape shape && !_keepWithNext && shape.Type == ShapeType.SolidObject)
         {
            CloneSolidObject(shape);
            _keepWithNext = true;
            return false;
         }
         _keepWithNext = false;
         return base.ShouldSplit(node);
      }
      private void CloneSolidObject(Shape shape)
      {
         if (shape.IsTextFrame)
         {
            _clonedShape = shape.Clone();
         }
         else
         {
            using (var memoryStream = new MemoryStream())
            {
               shape.CopyTo(memoryStream);
               _clonedShape = Shape.FromPKI(memoryStream);
            }
         }
      }
   }

Inheritance

object PageSplittingAlgorithm KeepPartAndCloneSolidObjectToNextPageAlgorithm

اعضای ارثی

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

هنگامی که صفحات طولانی OneNote در فرمت pdf ذخیره می شوند، آنها به صفحات تقسیم می شود. نمونه نشان می دهد که چگونه برای تنظیم منطق تقسیم اشیاء در شکاف های صفحه.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   var pdfSaveOptions = new PdfSaveOptions();
   pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(100);
   pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(400);
   dataDir += "PageSplittUsingKeepPartAndCloneSolidObjectToNextPageAlgorithm_out.pdf";
   doc.Save(dataDir);

هنگامی که صفحات طولانی OneNote در فرمت pdf ذخیره می شوند، آنها به صفحات تقسیم می شود.این مثال نشان می دهد که چگونه می توان منطق تقسیم اشیاء را در شکاف های صفحه تنظیم کرد.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   var pdfSaveOptions = new PdfSaveOptions();
   pdfSaveOptions.PageSplittingAlgorithm = new AlwaysSplitObjectsAlgorithm();
   float heightLimitOfClonedPart = 500;
   pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(heightLimitOfClonedPart);
   pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(100);
   dataDir += "UsingKeepSOlidObjectsAlgorithm_out.pdf";
   doc.Save(dataDir, pdfSaveOptions);
   pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(400);
   dataDir += "UsingKeepSOlidObjectsAlgorithm_outWithHigherLimit.pdf";
   doc.Save(dataDir, pdfSaveOptions);

Constructors

بایگانی برچسب هاPageAlgorithm()

شروع یک مثال جدید از Aspose.Note.Saving.KeepPartAndCloneSolidObjectToNextPageAlgorithm کلاس، با استفاده از حد ارتفاع پیش فرض از قطعه کلون شده.

public KeepPartAndCloneSolidObjectToNextPageAlgorithm()
   {
   }

KeepPartAndCloneSolidObjectToNextPageآلگوریتم(سفید)

شروع یک مثال جدید از Aspose.Note.Saving.KeepPartAndCloneSolidObjectToNextPageAlgorithm کلاس، با استفاده از محدودیت ارتفاع خاص از قطعه کلون شده.

public KeepPartAndCloneSolidObjectToNextPageAlgorithm(float heightLimitOfClonedPart)
   {
   }

Parameters

heightLimitOfClonedPart float

حداکثر ارتفاع قطعه کلون شده

Fields

DefaultHeightLimitOfClonedPart

حداکثر اندازه قطعه کلون شده

public const float DefaultHeightLimitOfClonedPart = 200;

ارزش میدان

float

Properties

HeightLimitOfClonedPart

محدودیت ارتفاع قسمت کلون شده را به دست می آورد.

public float HeightLimitOfClonedPart
   {
      get;
   }

ارزش املاک

float

 فارسی