Class KeepSolidObjectsAlgorithm

Class KeepSolidObjectsAlgorithm

이름 공간 : Aspose.Note.Saving 모임: Aspose.Note.dll (25.4.0)

원본 페이지에 맞지 않는 경우 전체 항목을 다음 페이지로 이동합니다.

public class KeepSolidObjectsAlgorithm : PageSplittingAlgorithm
   {
      private readonly double _minimumSpaceBetweenPages;
      private readonly double _maximumSpaceBetweenPages;
      public KeepSolidObjectsAlgorithm(double minimumSpaceBetweenPages, double maximumSpaceBetweenPages)
      {
         _minimumSpaceBetweenPages = minimumSpaceBetweenPages;
         _maximumSpaceBetweenPages = maximumSpaceBetweenPages;
      }
      protected override void AddPageBreak(Document document, PageLayout pageLayout, float pageNumber, bool isLastPageInSection)
      {
         double spaceBefore = FindSpaceBefore(document, pageLayout);
         if (IsSufficientSpaceForNextPage(spaceBefore))
            return;
         AddSpaceBetweenPages(document, pageNumber);
      }
      private bool IsSufficientSpaceForNextPage(double spaceBefore)
      {
         double sufficientSpace = _minimumSpaceBetweenPages;
         if (sufficientSpace > spaceBefore)
            sufficientSpace = spaceBefore;
         if (sufficientSpace >= _maximumSpaceBetweenPages)
            return true;
         return false;
      }
      private void AddSpaceBetweenPages(Document document, float pageNumber)
      {
         double spaceToAdd = FindNextPageStartPosition(document, pageNumber + 1) - GetLastContentEndPosition(document, pageNumber);
         if (spaceToAdd > 0.0)
            AddSpace(document, spaceToAdd);
      }
      private void AddSpace(Document document, double spaceToAdd)
      {
      }
   }

Inheritance

object PageSplittingAlgorithm KeepSolidObjectsAlgorithm

상속 회원들

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

Examples

지정된 옵션으로 PDF 형식으로 노트북을 저장하는 방법을 보여줍니다.

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
   var notebookSaveOptions = new NotebookPdfSaveOptions();
   var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
   documentSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm();
   dataDir += "ConvertToPDF_out.pdf";
   notebook.Save(dataDir, notebookSaveOptions);

지정된 옵션을 가진 표준 Windows 대화를 사용하여 프린터에 문서를 보내는 방법을 보여줍니다.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   var document = new Aspose.Note.Document(dataDir + "Aspose.one");
   var printerSettings = new PrinterSettings()
   {
      FromPage = 0,
      ToPage = 10
   };
   printerSettings.DefaultPageSettings.Landscape = true;
   printerSettings.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 150, 50);
   document.Print(new PrintOptions()
   {
      PrinterSettings = printerSettings,
      Resolution = 1200,
      PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(),
      DocumentName = "Test.one"
   });

긴 OneNote 페이지가 PDF 형식으로 저장되면 페이지로 분할됩니다.이 예제는 페이지의 붕괴에 위치한 개체의 분열 논리를 구성하는 방법을 보여줍니다.

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

Constructors

알레르기 옵션(Algorithm)

Aspose.Note.Saving.KeepSolidObjectsAlgorithm 클래스를 사용하여 클론 된 부분의 기본 높이 제한을 시작합니다.

public KeepSolidObjectsAlgorithm()
   {
   }

KeepSolidObjects알고리즘(플로이트)

Aspose.Note.Saving.KeepSolidObjects알고리즘 클래스를 사용하여 클론 된 부분의 특정 높이 한도를 시작합니다.

public KeepSolidObjectsAlgorithm(float heightLimitOfClonedPart)
   {
   }

Parameters

heightLimitOfClonedPart float

클론된 부분의 최대 높이.

Fields

DefaultHeightLimitOfClonedPart

클론된 부분의 기본 최대 크기.

public const float DefaultHeightLimitOfClonedPart = 200;

필드 가치

float

Properties

HeightLimitOfClonedPart

클론 된 부분의 높이 제한을 얻습니다.

public float HeightLimitOfClonedPart
   {
      get;
   }

부동산 가치

float

 한국어