Class KeepSolidObjectsAlgorithm
Class KeepSolidObjectsAlgorithm
名称: Aspose.Note.Saving 集合: Aspose.Note.dll (25.4.0)
将整个对象转移到下一页,如果它不适合原始页面。
public class KeepSolidObjectsAlgorithm : PageSplittingAlgorithm
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 格式中保存笔记本,并提供指定的选项。
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
var notebookSaveOptions = new NotebookPdfSaveOptions();
var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
documentSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm();
dataDir = dataDir + "ConvertToPDF_out.pdf";
// Save the Notebook
notebook.Save(dataDir, notebookSaveOptions);
显示如何将文档发送到打印机,使用默认的 Windows 对话与指定的选项。
// The path to the documents directory.
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 格式时,它们分为各页。
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
var pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.PageSplittingAlgorithm = new AlwaysSplitObjectsAlgorithm();
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm();
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm();
float heightLimitOfClonedPart = 500;
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(heightLimitOfClonedPart);
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(heightLimitOfClonedPart);
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(100);
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(400);
dataDir = dataDir + "UsingKeepSOlidObjectsAlgorithm_out.pdf";
doc.Save(dataDir);
Constructors
KeepSolidObjectsAlgorithm()
启动一个新的例子 Aspose.Note.Saving.KeepSolidObjectsAlgorithm 类使用默认高度限制的克隆部分。
public KeepSolidObjectsAlgorithm()
KeepSolidObjectsAlgorithm(航海)
启动一个新的例子 Aspose.Note.Saving.KeepSolidObjectsAlgorithm 类使用特定的高度限制的克隆部分。
public KeepSolidObjectsAlgorithm(float heightLimitOfClonedPart)
Parameters
heightLimitOfClonedPart
float
克隆部分的最大高度。
Fields
DefaultHeightLimitOfClonedPart
默认的 max 尺寸的克隆部分。
public const float DefaultHeightLimitOfClonedPart = 200
领域价值
Properties
HeightLimitOfClonedPart
得到了克隆部分的高度限制。
public float HeightLimitOfClonedPart { get; }