Class Notebook
이름 공간 : Aspose.Note 모임: Aspose.Note.dll (25.4.0)
Aspose.Note 노트북을 소개합니다.
public class Notebook : INotebookChildNode, IEnumerable<inotebookchildnode>, IEnumerable
{
public void Add(inotebookchildnode childNode)
{
_children.Add(childNode);
}
public void Remove(inotebookchildnode childNode)
{
_children.Remove(childNode);
}
public bool Contains(inotebookchildnode childNode)
{
return _children.Contains(childNode);
}
IEnumerator IEnumerable.GetEnumerator()
{
foreach (var child in _children)
yield return child;
}
IEnumerator<inotebookchildnode> IEnumerable<inotebookchildnode>.GetEnumerator()
{
foreach (var child in _children)
yield return child;
}
private List<inotebookchildnode> _children = new List<inotebookchildnode>();
}
Inheritance
Implements
INotebookChildNode
,
IEnumerable
상속 회원들
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
노트북을 저장하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook();
dataDir += "test_out.onetoc2";
notebook.Save(dataDir);
PDF 형식으로 노트북을 저장하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
dataDir += "ConvertToPDF_out.pdf";
notebook.Save(dataDir);
사진으로 노트북을 저장하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
dataDir += "ConvertToImage_out.png";
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);
}
플레이트 노트북을 PDF 형식으로 저장하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
dataDir += "ConvertToPDFAsFlattened_out.pdf";
notebook.Save(
dataDir,
new NotebookPdfSaveOptions
{
Flatten = true
});
노트북의 문서를 통해 이테라이트하는 방법을 보여주고 그들을 깔끔하게 충전합니다.
string inputFile = "Notizbuch öffnen.onetoc2";
string dataDir = RunExamples.GetDataDir_NoteBook();
Notebook notebook = new Notebook(dataDir + inputFile);
foreach (var notebookChildNode in notebook.OfType<Document>())
{
}
노트북에 새로운 섹션을 추가하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
notebook.AppendChild(new Document(dataDir + "Neuer Abschnitt 1.one"));
dataDir += @"\AddChildNode_out.onetoc2";
notebook.Save(dataDir);
흐름에서 노트북을 충전하는 방법을 보여줍니다.
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");
암호화 된 노트북을 만드는 방법을 보여줍니다.
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" });
지정된 옵션으로 노트북을 이미지로 저장하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
var notebookSaveOptions = new NotebookImageSaveOptions { SaveFormat = SaveFormat.Png };
var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
documentSaveOptions.Resolution = 400;
dataDir += "ConvertToImageWithOptions_out.png";
notebook.Save(dataDir, notebookSaveOptions);
그림으로 플레이트 노트북을 저장하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_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 += "ConvertToImageAsFlattenedNotebook_out.png";
notebook.Save(dataDir, notebookSaveOptions);
노트북에서 섹션을 제거하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "test.onetoc2");
foreach (var child in new List<inotebookchildnode>(notebook))
{
if (child.DisplayName == "Remove Me")
{
notebook.RemoveChild(child);
}
}
dataDir = dataDir + "RemoveChildNode_out.onetoc2";
notebook.Save(dataDir);
노트북의 사전 업로드 된 문서를 통해 iterate하는 방법을 보여줍니다.
NotebookLoadOptions loadOptions = new NotebookLoadOptions { InstantLoading = true };
string inputFile = "Notizbuch öffnen.onetoc2";
string dataDir = RunExamples.GetDataDir_NoteBook();
Notebook notebook = new Notebook(dataDir + inputFile, loadOptions);
foreach (INotebookChildNode notebookChildNode in notebook.OfType<Document>())
{
}
노트북의 콘텐츠를 통과하는 방법을 보여줍니다.
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)
{
}
else if (notebookChildNode is Notebook)
{
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Constructors
노트북( )
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.
public Notebook()
{
}
노트북 (String)
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.파일에서 기존 OneNote 노트북을 열어줍니다.
public Notebook(string filePath)
{
}
Parameters
filePath
string
파일 경로 입니다.
노트북(string, 노드북LoadOptions)
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.파일에서 기존 OneNote 노트북을 열어 추가 옵션을 지정할 수 있습니다, 예를 들어 어린이 충전 전략 (‘lazy’/instant).
public Notebook(string filePath, NotebookLoadOptions loadOptions)
{
}
Parameters
filePath
string
파일 경로 입니다.
loadOptions
NotebookLoadOptions
로드 옵션
노트북 ( Stream )
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.기존 OneNote 노트북을 스트림에서 열어줍니다.
public class Notebook
{
public Notebook(Stream stream)
{
}
}
Parameters
stream
Stream
그 흐름을
노트북(스트레임, NotebookLoadOptions)
Aspose.Note.Notebook 클래스의 새로운 예를 시작합니다.흐름에서 기존 OneNote 노트북을 열어 추가 충전 옵션을 지정할 수 있습니다.
public Notebook(Stream stream, NotebookLoadOptions loadOptions)
{
}
Parameters
stream
Stream
그 흐름을
loadOptions
NotebookLoadOptions
로드 옵션
Properties
Color
그것은 색을 얻거나 설정합니다.
public Color Color
{
get
{
return this.Color;
}
set
{
this.Color = value;
}
}
부동산 가치
Count
Aspose.Note.Notebook에 포함된 항목의 수를 얻습니다.
public int Count
{
get;
}
부동산 가치
DisplayName
디스플레이 이름을 얻거나 설정합니다.
public string DisplayName
{
get;
set;
}
부동산 가치
Examples
노트북에서 섹션을 제거하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "test.onetoc2");
foreach (var child in new List<InotebookChildNode>(notebook))
{
if (child.DisplayName == "Remove Me")
{
notebook.RemoveChild(child);
}
}
dataDir = dataDir + "RemoveChildNode_out.onetoc2";
notebook.Save(dataDir);
Notes:
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
애플리케이션(InotebookChildNode)
목록의 끝에 노드를 추가합니다.
public INotebookChildNode AppendChild(INotebookChildNode newChild)
{
return _notebook.AppendChild(newChild);
}
Parameters
newChild
INotebookChildNode
노드가 추가됩니다.
Returns
추가된 노드
GetChildNodes()
노드 유형에 따라 모든 어린이 노드를 얻으십시오.
public IList<T1> GetChildNodes<T1>() where T1 : Node
{
}
Returns
어린이 노드 목록.
파라미터 유형
T1
반환 목록의 항목의 유형.
숫자( )
그것은 Aspose.Note.Notebook의 어린이 노드를 통해 이테레이션하는 번호를 반환합니다.
public IEnumerator<notebookchildnode> GetEnumerator()
{
}
Returns
IEnumerator <에 대한 정보 INotebookChildNode >
모델 번호:IEnumerator
LoadChildDocument(스트링)
어린이 문서 노드를 추가합니다.파일에서 기존 OneNote 문서를 열어줍니다.
public void LoadChildDocument(string filePath)
{
}
Parameters
filePath
string
파일 경로 입니다.
Examples
흐름에서 노트북을 충전하는 방법을 보여줍니다.
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(스트링, LoatOptions)
어린이 문서 노드를 추가합니다.파일에서 기존 OneNote 문서를 열어 추가 로드 옵션을 지정할 수 있습니다.
public void LoadChildDocument(string filePath, Aspose.Words.LoadOptions loadOptions)
{
}
Parameters
filePath
string
파일 경로 입니다.
loadOptions
LoadOptions
로드 옵션
LoadChildDocument( 스트림)
어린이 문서 노드를 추가합니다.흐름에서 기존 OneNote 문서를 열어줍니다.
public void LoadChildDocument(Stream stream)
{
}
Parameters
stream
Stream
그 흐름을
Examples
흐름에서 노트북을 충전하는 방법을 보여줍니다.
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(스트림, 로드 옵션)
어린이 문서 노드를 추가합니다.흐름에서 기존 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(스트레임)
어린이 노트북 노드를 추가합니다.기존 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(이노트북시드노드)
아이의 노드를 제거합니다.
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);
}
노트북에서 섹션을 제거하는 방법을 보여줍니다.
string dataDir = RunExamples.GetDataDir_NoteBook();
var notebook = new Notebook(dataDir + "test.onetoc2");
foreach (var child in new List<inotebookchildnode>(notebook))
{
if (child.DisplayName == "Remove Me")
{
notebook.RemoveChild(child);
}
}
dataDir = dataDir + "RemoveChildNode_out.onetoc2";
notebook.Save(dataDir);
노트북을 저장하는 방법을 보여줍니다.
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 + "NotLocked_out.one");
var childDocument1 = notebook[1] as Document;
childDocument1.Save(dataDir + "LockedPass1_out.one", new OneSaveOptions() { DocumentPassword = "pass" });
var childDocument2 = notebook[2] as Document;
childDocument2.Save(dataDir + "LockedPass2_out.one", new OneSaveOptions() { DocumentPassword = "pass2" });
}
스테인리스 ( String )
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
요청된 저장 형식은 지원되지 않습니다.
저장(String, SaveFormat)
OneNote 문서를 지정된 형식의 파일로 저장합니다.
public void Save(string fileName, Aspose.Words.SaveFormat format)
{
}
Parameters
fileName
string
지정된 전체 이름을 가진 파일이 이미 존재한다면, 기존 파일은 과장됩니다.
format
SaveFormat
문서를 저장할 수 있는 형식입니다.
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.
저장(Stream, SaveFormat)
OneNote 문서를 지정된 형식의 스트림으로 저장합니다.
public void Save(Stream stream, SaveFormat format)
{
}
Parameters
stream
Stream
그 흐름을
format
SaveFormat
문서를 저장할 수 있는 형식입니다.
Exceptions
IncorrectDocumentStructureException
문서 구조는 사양을 위반합니다.
UnsupportedSaveFormatException
요청된 저장 형식은 지원되지 않습니다.
저장(string, NotebookSaveOptions)
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
요청된 저장 형식은 지원되지 않습니다.