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.KeepPartAndCloneSolidObjectToNextPageアルゴリズムクラスの新しい例を開始し、既定のクローンされた部分の高さ制限を使用します。
public KeepPartAndCloneSolidObjectToNextPageAlgorithm()
{
}
KeepPartAndCloneSolidObjectToNextPageアルゴリズム(フロア)
Aspose.Note.Saving.KeepPartAndCloneSolidObjectToNextPageアルゴリズムクラスの新しい例を開始し、特定の高さ制限を使用します。
public KeepPartAndCloneSolidObjectToNextPageAlgorithm(float heightLimitOfClonedPart)
{
}
Parameters
heightLimitOfClonedPart
float
クローンされた部分の最大高さ。
Fields
DefaultHeightLimitOfClonedPart
デフォルト マックス クローン パーツサイズ
public const float DefaultHeightLimitOfClonedPart = 200;
フィールド価値
Properties
HeightLimitOfClonedPart
クローンされた部分の高さ制限を取得します。
public float HeightLimitOfClonedPart
{
get;
}