Class KeepSolidObjectsAlgorithm

Class KeepSolidObjectsAlgorithm

Navne til: Aspose.Note.Saving Sammensætning: Aspose.Note.dll (25.4.0)

Flytter det fulde objekt til næste side, hvis det ikke passer til den oprindelige side.

public class KeepSolidObjectsAlgorithm : PageSplittingAlgorithm

Inheritance

object PageSplittingAlgorithm KeepSolidObjectsAlgorithm

De arvede medlemmer

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

Examples

Se, hvordan man gemmer en notebook i pdf-format med angivne muligheder.

// 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);

Se, hvordan man sender dokument til en printer ved hjælp af standard Windows-dialog med angivne muligheder.

// 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"
                                                                                                                       });

Når lange OneNote-sider gemmes i pdf-format, deles de mellem sider. eksemplet viser, hvordan man konfigurerer splittelseslogikken for objekter, der er placeret på siderne.

// 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()

Initialiserer en ny instans af Aspose.Note.Saving.KeepSolidObjectsAlgorithm klasse ved hjælp af standard højdegrænse for klonede dele.

public KeepSolidObjectsAlgorithm()

KeepSolidObjectsAlgorithm(Flåder)

Initialiserer en ny instans af Aspose.Note.Saving.KeepSolidObjectsAlgorithm klasse ved hjælp af en specifik højdegrænse for klonede dele.

public KeepSolidObjectsAlgorithm(float heightLimitOfClonedPart)

Parameters

heightLimitOfClonedPart float

Max højde af klonede dele.

Fields

DefaultHeightLimitOfClonedPart

Den standard max størrelse af klonede dele.

public const float DefaultHeightLimitOfClonedPart = 200

Fællesværdi

float

Properties

HeightLimitOfClonedPart

Giver højdegrænsen for den klonede del.

public float HeightLimitOfClonedPart { get; }

Ejendomsværdi

float

 Dansk