Class KeepSolidObjectsAlgorithm
Nom dels espais: Aspose.Note.Saving Assemblea: Aspose.Note.dll (25.4.0)
Canvia l’objecte complet a la següent pàgina en cas que no estigui en la pàgina original.
public class KeepSolidObjectsAlgorithm : PageSplittingAlgorithm
Inheritance
object ← PageSplittingAlgorithm ← KeepSolidObjectsAlgorithm
Membres heretats
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Mostra com salvar el notebook en format pdf amb les opcions especificades.
// 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);
Mostra com enviar un document a una impressora utilitzant el diàleg de Windows estàndard amb opcions especificades.
// 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"
});
Quan les llargues pàgines de OneNote s’emmagatzemen en format pdf, es divideixen entre pàgs. L’exemple mostra com configurar la lògica de divisió dels objectes localitzats en les pauses de la pàgina.
// 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()
Inicialitza una nova instància de la classe Aspose.Note.Saving.KeepSolidObjectsAlgorithm utilitzant el límit d’altura estàndard de part clonada.
public KeepSolidObjectsAlgorithm()
KeepSolidObjectsAlgorithm(Float)
Inicialitza una nova instància de la classe Aspose.Note.Saving.KeepSolidObjectsAlgorithm utilitzant un límit d’altura específic de part clonada.
public KeepSolidObjectsAlgorithm(float heightLimitOfClonedPart)
Parameters
heightLimitOfClonedPart
float
L’altura màxima de la part clonada.
Fields
DefaultHeightLimitOfClonedPart
La mida màxima de la part clonada.
public const float DefaultHeightLimitOfClonedPart = 200
Valor de camp
Properties
HeightLimitOfClonedPart
Obté el límit d’altura de la part clonada.
public float HeightLimitOfClonedPart { get; }