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
KeepPartAndCloneSolidObjectToNextPage알고리즘()
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;
필드 가치
Properties
HeightLimitOfClonedPart
클론 된 부분의 높이 제한을 얻습니다.
public float HeightLimitOfClonedPart
{
get;
}