Class Notebook
이름 공간 : Aspose.Note 모임: Aspose.Note.dll (25.4.0)
WL31_ 노트북을 나타냅니다.
public class Notebook : INotebookChildNode, IEnumerable<inotebookchildnode>, IEnumerable
Inheritance
Implements
INotebookChildNode
,
IEnumerable
상속 회원들
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
노트북을 저장하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook();
dataDir = dataDir + "test_out.onetoc2";
// Save the Notebook
notebook.Save(dataDir);
PDF 형식으로 노트북을 저장하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
dataDir = dataDir + "ConvertToPDF_out.pdf";
// Save the Notebook
notebook.Save(dataDir);
사진으로 노트북을 저장하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
dataDir = dataDir + "ConvertToImage_out.png";
// Save the Notebook
notebook.Save(dataDir);
노트북에서 모든 텍스트를 얻는 방법을 보여줍니다.
string inputFile = "notebook.onetoc2";
string dataDir = RunExamples.GetDataDir_NoteBook();
Notebook rootNotebook = new Notebook(dataDir + inputFile);
IList<richtext> allRichTextNodes = rootNotebook.GetChildNodes<richtext>();
foreach (RichText richTextNode in allRichTextNodes)
{
Console.WriteLine(richTextNode.Text);
}</richtext></richtext>
플레이트 노트북을 PDF 형식으로 저장하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
// Save the Notebook
dataDir = dataDir + "ConvertToPDFAsFlattened_out.pdf";
notebook.Save(
dataDir,
new NotebookPdfSaveOptions
{
Flatten = true
});
노트북의 문서를 통해 이테라이트하는 방법을 보여주고 그들을 깔끔하게 충전합니다.
string inputFile = "Notizbuch öffnen.onetoc2";
string dataDir = RunExamples.GetDataDir_NoteBook();
// By default children loading is "lazy".
Notebook notebook = new Notebook(dataDir + inputFile);
foreach (var notebookChildNode in notebook.OfType<document>())
{
// Actual loading of the child document happens only here.
// Do something with child document
}</document>
노트북에 새로운 섹션을 추가하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
// Append a new child to the Notebook
notebook.AppendChild(new Document(dataDir + "Neuer Abschnitt 1.one"));
dataDir = dataDir + "AddChildNode_out.onetoc2";
// Save the Notebook
notebook.Save(dataDir);
흐름에서 노트북을 충전하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
FileStream stream = new FileStream(dataDir + "Notizbuch öffnen.onetoc2", FileMode.Open);
var notebook = new Notebook(stream);
using (FileStream childStream = new FileStream(dataDir + "Aspose.one", FileMode.Open))
{
notebook.LoadChildDocument(childStream);
}
notebook.LoadChildDocument(dataDir + "Sample1.one");
암호화 된 노트북을 만드는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "test.onetoc2", new NotebookLoadOptions() { DeferredLoading = true });
notebook.LoadChildDocument(dataDir + "Aspose.one");
notebook.LoadChildDocument(dataDir + "Locked Pass1.one", new LoadOptions() { DocumentPassword = "pass" });
notebook.LoadChildDocument(dataDir + "Locked Pass2.one", new LoadOptions() { DocumentPassword = "pass2" });
지정된 옵션으로 노트북을 이미지로 저장하는 방법을 보여줍니다.
// 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 NotebookImageSaveOptions(SaveFormat.Png);
var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
documentSaveOptions.Resolution = 400;
dataDir = dataDir + "ConvertToImageWithOptions_out.png";
// Save the Notebook
notebook.Save(dataDir, notebookSaveOptions);
그림으로 플레이트 노트북을 저장하는 방법을 보여줍니다.
// 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 NotebookImageSaveOptions(SaveFormat.Png);
var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
documentSaveOptions.Resolution = 400;
notebookSaveOptions.Flatten = true;
dataDir = dataDir + "ConvertToImageAsFlattenedNotebook_out.png";
// Save the Notebook
notebook.Save(dataDir, notebookSaveOptions);
노트북에서 섹션을 제거하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "test.onetoc2");
// Traverse through its child nodes for searching the desired child item
foreach (var child in new List<inotebookchildnode>(notebook))
{
if (child.DisplayName == "Remove Me")
{
// Remove the Child Item from the Notebook
notebook.RemoveChild(child);
}
}
dataDir = dataDir + "RemoveChildNode_out.onetoc2";
// Save the Notebook
notebook.Save(dataDir);</inotebookchildnode>
노트북의 사전 업로드 된 문서를 통해 iterate하는 방법을 보여줍니다.
// By default children loading is "lazy".
// Therefore for instant loading has took place,
// it is necessary to set the NotebookLoadOptions.InstantLoading flag.
NotebookLoadOptions loadOptions = new NotebookLoadOptions { InstantLoading = true };
String inputFile = "Notizbuch öffnen.onetoc2";
String dataDir = RunExamples.GetDataDir_NoteBook();
Notebook notebook = new Notebook(dataDir + inputFile, loadOptions);
// All child documents are already loaded.
foreach (INotebookChildNode notebookChildNode in notebook.OfType<document>())
{
// Do something with child document
}</document>
노트북의 콘텐츠를 통과하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = "Open Notebook.onetoc2";
try
{
var notebook = new Notebook(dataDir + fileName);
foreach (var notebookChildNode in notebook)
{
Console.WriteLine(notebookChildNode.DisplayName);
if (notebookChildNode is Document)
{
// Do something with child document
}
else if (notebookChildNode is Notebook)
{
// Do something with child notebook
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Constructors
Notebook()
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.
public Notebook()
Notebook(스트리트)
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.파일에서 기존 OneNote 노트북을 열어줍니다.
public Notebook(string filePath)
Parameters
filePath
string
파일 경로 입니다.
Notebook(링크, 노트북LoadOptions)
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.파일에서 기존 OneNote 노트북을 열어 추가 옵션을 지정할 수 있습니다, 예를 들어 어린이 충전 전략 (‘lazy’/instant).
public Notebook(string filePath, NotebookLoadOptions loadOptions)
Parameters
filePath
string
파일 경로 입니다.
loadOptions
NotebookLoadOptions
로드 옵션
Notebook(Stream)
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.기존 OneNote 노트북을 스트림에서 열어줍니다.
public Notebook(Stream stream)
Parameters
stream
Stream
그 흐름을
Notebook(흐름, 노트북LoadOptions)
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.흐름에서 기존 OneNote 노트북을 열어 추가 충전 옵션을 지정할 수 있습니다.
public Notebook(Stream stream, NotebookLoadOptions loadOptions)
Parameters
stream
Stream
그 흐름을
loadOptions
NotebookLoadOptions
로드 옵션
Properties
Color
그것은 색을 얻거나 설정합니다.
public Color Color { get; set; }
부동산 가치
Count
Aspose.Note.Notebook에 포함된 항목의 수를 얻습니다.
public int Count { get; }
부동산 가치
DisplayName
디스플레이 이름을 얻거나 설정합니다.
public string DisplayName { get; set; }
부동산 가치
Examples
노트북에서 섹션을 제거하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "test.onetoc2");
// Traverse through its child nodes for searching the desired child item
foreach (var child in new List<inotebookchildnode>(notebook))
{
if (child.DisplayName == "Remove Me")
{
// Remove the Child Item from the Notebook
notebook.RemoveChild(child);
}
}
dataDir = dataDir + "RemoveChildNode_out.onetoc2";
// Save the Notebook
notebook.Save(dataDir);</inotebookchildnode>
FileFormat
파일 형식을 얻습니다 (OneNote 2010, 하나노트 온라인).
public FileFormat FileFormat { get; }
부동산 가치
Guid
객체의 세계적으로 독특한 ID를 얻습니다.
public Guid Guid { get; }
부동산 가치
IsHistoryEnabled
역사가 활성화되어 있는지 여부를 나타내는 값을 얻거나 설정합니다.
public bool IsHistoryEnabled { get; set; }
부동산 가치
이것이[이트]
노트북 어린이 노드를 지정된 인덱스에 의해 얻습니다.
public INotebookChildNode this[int index] { get; }
부동산 가치
Methods
AppendChild(인테리어ChildNode)
목록의 끝에 노드를 추가합니다.
public INotebookChildNode AppendChild(INotebookChildNode newChild)
Parameters
newChild
INotebookChildNode
노드가 추가됩니다.
Returns
추가된 노드
트레일러 ()
노드 유형에 따라 모든 어린이 노드를 얻으십시오.
public IList<t1> GetChildNodes<t1>() where T1 : Node
Returns
어린이 노드 목록.
파라미터 유형
T1
반환 목록의 항목의 유형.
GetEnumerator()
그것은 Aspose.Note.Notebook의 어린이 노드를 통해 이테레이션하는 번호를 반환합니다.
public IEnumerator<inotebookchildnode> GetEnumerator()
Returns
IEnumerator <에 대한 정보 INotebookChildNode >
모델 번호:IEnumerator
LoadChildDocument(스트리트)
어린이 문서 노드를 추가합니다.파일에서 기존 OneNote 문서를 열어줍니다.
public void LoadChildDocument(string filePath)
Parameters
filePath
string
파일 경로 입니다.
Examples
흐름에서 노트북을 충전하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
FileStream stream = new FileStream(dataDir + "Notizbuch öffnen.onetoc2", FileMode.Open);
var notebook = new Notebook(stream);
using (FileStream childStream = new FileStream(dataDir + "Aspose.one", FileMode.Open))
{
notebook.LoadChildDocument(childStream);
}
notebook.LoadChildDocument(dataDir + "Sample1.one");
LoadChildDocument(링크, LoadOptions)
어린이 문서 노드를 추가합니다.파일에서 기존 OneNote 문서를 열어 추가 로드 옵션을 지정할 수 있습니다.
public void LoadChildDocument(string filePath, LoadOptions loadOptions)
Parameters
filePath
string
파일 경로 입니다.
loadOptions
LoadOptions
로드 옵션
LoadChildDocument(Stream)
어린이 문서 노드를 추가합니다.흐름에서 기존 OneNote 문서를 열어줍니다.
public void LoadChildDocument(Stream stream)
Parameters
stream
Stream
그 흐름을
Examples
흐름에서 노트북을 충전하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
FileStream stream = new FileStream(dataDir + "Notizbuch öffnen.onetoc2", FileMode.Open);
var notebook = new Notebook(stream);
using (FileStream childStream = new FileStream(dataDir + "Aspose.one", FileMode.Open))
{
notebook.LoadChildDocument(childStream);
}
notebook.LoadChildDocument(dataDir + "Sample1.one");
LoadChildDocument(흐름, LoadOptions)
어린이 문서 노드를 추가합니다.흐름에서 기존 OneNote 문서를 열어 추가 로드 옵션을 지정할 수 있습니다.
public void LoadChildDocument(Stream stream, LoadOptions loadOptions)
Parameters
stream
Stream
그 흐름을
loadOptions
LoadOptions
로드 옵션
LoadChildNotebook(스트리트)
어린이 노트북 노드를 추가합니다.파일에서 기존 OneNote 노트북을 열어줍니다.
public void LoadChildNotebook(string filePath)
Parameters
filePath
string
파일 경로 입니다.
LoadChildNotebook(링크, 노트북LoadOptions)
어린이 노트북 노드를 추가합니다.파일에서 기존 OneNote 노트북을 열어 추가 로드 옵션을 지정할 수 있습니다.
public void LoadChildNotebook(string filePath, NotebookLoadOptions loadOptions)
Parameters
filePath
string
파일 경로 입니다.
loadOptions
NotebookLoadOptions
로드 옵션
LoadChildNotebook(Stream)
어린이 노트북 노드를 추가합니다.기존 OneNote 노트북을 스트림에서 열어줍니다.
public void LoadChildNotebook(Stream stream)
Parameters
stream
Stream
그 흐름을
LoadChildNotebook(흐름, 노트북LoadOptions)
어린이 노트북 노드를 추가합니다.흐름에서 기존 OneNote 노트북을 열어 추가 로드 옵션을 지정할 수 있습니다.
public void LoadChildNotebook(Stream stream, NotebookLoadOptions loadOptions)
Parameters
stream
Stream
그 흐름을
loadOptions
NotebookLoadOptions
로드 옵션
RemoveChild(인테리어ChildNode)
아이의 노드를 제거합니다.
public INotebookChildNode RemoveChild(INotebookChildNode oldChild)
Parameters
oldChild
INotebookChildNode
제거하기 위한 노드
Returns
제거된 노드
Examples
노트북에서 모든 섹션에 액세스하는 방법을 보여줍니다.
string inputFile = "notebook.onetoc2";
string dataDir = RunExamples.GetDataDir_NoteBook();
Notebook rootNotebook = new Notebook(dataDir + inputFile);
IList<document> allDocuments = rootNotebook.GetChildNodes<document>();
foreach (Document document in allDocuments)
{
Console.WriteLine(document.DisplayName);
}</document></document>
노트북에서 섹션을 제거하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "test.onetoc2");
// Traverse through its child nodes for searching the desired child item
foreach (var child in new List<inotebookchildnode>(notebook))
{
if (child.DisplayName == "Remove Me")
{
// Remove the Child Item from the Notebook
notebook.RemoveChild(child);
}
}
dataDir = dataDir + "RemoveChildNode_out.onetoc2";
// Save the Notebook
notebook.Save(dataDir);</inotebookchildnode>
노트북을 저장하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "test.onetoc2", new NotebookLoadOptions() { DeferredLoading = false });
notebook.Save(dataDir + "notebook_out.onetoc2", new NotebookOneSaveOptions() { DeferredSaving = true});
if (notebook.Any())
{
var childDocument0 = notebook[0] as Document;
childDocument0.Save(dataDir + "Not Locked_out.one");
var childDocument1 = notebook[1] as Document;
childDocument1.Save(dataDir + "Locked Pass1_out.one", new OneSaveOptions() { DocumentPassword = "pass" });
var childDocument2 = notebook[2] as Document;
childDocument2.Save(dataDir + "Locked Pass2_out.one", new OneSaveOptions() { DocumentPassword = "pass2" });
}
Save(스트리트)
OneNote 문서를 파일로 저장합니다.
public void Save(string fileName)
Parameters
fileName
string
지정된 전체 이름을 가진 파일이 이미 존재한다면, 기존 파일은 과장됩니다.
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.
Save(Stream)
OneNote 문서를 스트림으로 저장합니다.
public void Save(Stream stream)
Parameters
stream
Stream
그 흐름을
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.
Save(링크, SaveFormat)
OneNote 문서를 지정된 형식의 파일로 저장합니다.
public void Save(string fileName, SaveFormat format)
Parameters
fileName
string
지정된 전체 이름을 가진 파일이 이미 존재한다면, 기존 파일은 과장됩니다.
format
SaveFormat
문서를 저장할 수 있는 형식입니다.
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.
Save(흐름, SaveFormat)
OneNote 문서를 지정된 형식의 스트림으로 저장합니다.
public void Save(Stream stream, SaveFormat format)
Parameters
stream
Stream
그 흐름을
format
SaveFormat
문서를 저장할 수 있는 형식입니다.
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.
Save(링크, 노트북SaveOptions)
OneNote 문서를 지정된 저장 옵션을 사용하여 파일에 보관합니다.
public void Save(string fileName, NotebookSaveOptions options)
Parameters
fileName
string
지정된 전체 이름을 가진 파일이 이미 존재한다면, 기존 파일은 과장됩니다.
options
NotebookSaveOptions
문서가 파일에 저장되는 방법에 대한 옵션을 지정합니다.
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.
Save(스트림, 노트북SaveOptions)
OneNote 문서를 지정된 저장 옵션을 사용하여 스트림으로 저축합니다.
public void Save(Stream stream, NotebookSaveOptions options)
Parameters
stream
Stream
그 흐름을
options
NotebookSaveOptions
문서가 어떻게 저장되는지에 대한 옵션을 지정합니다.
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.