Class KeepSolidObjectsAlgorithm
Numele spaţiului: Aspose.Note.Saving Asamblare: Aspose.Note.dll (25.4.0)
Schimbați obiectul complet la următoarea pagină în cazul în care nu se potrivește cu pagina originală.
public class KeepSolidObjectsAlgorithm : PageSplittingAlgorithm
Inheritance
object ← PageSplittingAlgorithm ← KeepSolidObjectsAlgorithm
Membrii moștenitori
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
arată cum să salvați notebook-ul în format PDF cu opțiuni specificate.
// 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);
Descrie modul de a trimite un document la un imprimantă folosind dialogul standard Windows cu opțiuni specificate.
// 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"
});
Atunci când paginile lungi OneNote sunt salvate în format pdf, ele sunt împărțite pe pagini. exemplul arată cum să se configureze logica divizării obiectelor situate pe pauzele paginii.
// 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()
Inițializează o nouă instanță a Aspose.Note.Saving.KeepSolidObjectsClasă de algoritm folosind limita de înălțime predefinită a părții clonate.
public KeepSolidObjectsAlgorithm()
KeepSolidObjectsAlgorithm(float)
Inițializează o nouă instanță a Aspose.Note.Saving.KeepSolidObjectsClasă de algoritm folosind un anumit limit de înălțime al părții clonate.
public KeepSolidObjectsAlgorithm(float heightLimitOfClonedPart)
Parameters
heightLimitOfClonedPart
float
Înălțimea max a părții clonate.
Fields
DefaultHeightLimitOfClonedPart
Dimensiunea maxă a părții clonate.
public const float DefaultHeightLimitOfClonedPart = 200
Valoarea câmpului
Properties
HeightLimitOfClonedPart
Obține limita de înălțime a părții clonate.
public float HeightLimitOfClonedPart { get; }